-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs($http): correct and clarify default transforms #15906
Conversation
- baddata error described incorrect http behavior, and workarounds - httpProvider defaults were missing transformResponse / transformRequest - http was not clear about JSON detection strategy Closes angular#15897
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
src/ng/http.js
Outdated
* into JSON format. | ||
* | ||
* - **`defaults.transformResponse`** - | ||
* `{Array<function(data, headersGetter, status)>|function((data, headersGetter, status))}` - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why double ((
/))
in function((...))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a typo
src/ng/http.js
Outdated
* An array of functions (or a single function) which are applied to the response data. By default, | ||
* this is an array which applies one response transformation function that does two things: | ||
* | ||
* - If XSRF prefix is detected, strip it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "XSRF prefix" is accurate. The prefix won't prevent an XSRF afaict, it will just prevent a potential XSRF vulnerability to be combined with other vulnerabilities.
EDIT: I see you've copied it from elsewhere. I'm not 100% sure, so I don't feel strongly about it 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering about this too .. let's keep it for now
Closes #15897