Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs($http): correct and clarify default transforms #15906

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Apr 10, 2017

  • baddata error described incorrect http behavior, and workarounds
  • httpProvider defaults were missing transformResponse / transformRequest
  • http was not clear about JSON detection strategy

Closes #15897

- 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
Copy link
Member

@gkalpak gkalpak left a 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))}` -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why double ((/)) in function((...))?

Copy link
Contributor Author

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
Copy link
Member

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 😁

Copy link
Contributor Author

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

@Narretz Narretz merged commit e23782b into angular:master Apr 12, 2017
Narretz added a commit that referenced this pull request Apr 21, 2017
- baddata error described incorrect http behavior, and workarounds
- httpProvider defaults were missing transformResponse / transformRequest
- http was not clear about JSON detection strategy

Closes #15897 
Closes #15906
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants