Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseResponseHeaders does not follow HTTP spec of optional spaces #4122

Closed
varoot opened this issue Jan 28, 2016 · 0 comments · Fixed by #4137
Closed

parseResponseHeaders does not follow HTTP spec of optional spaces #4122

varoot opened this issue Jan 28, 2016 · 0 comments · Fixed by #4137
Labels
🏷️ bug This PR primarily fixes a reported issue

Comments

@varoot
Copy link

varoot commented Jan 28, 2016

According to HTTP spec, a header field has optional leading whitespace. Currently, parseResponseHeaders requires a space character. It does not allow a TAB character, or no whitespace at all.

Also, we should trim the value since, according to the spec, the header values cannot have whitespace on either end.

@bmac bmac added the Bug label Feb 4, 2016
HeroicEric added a commit to HeroicEric/data that referenced this issue Feb 6, 2016
This pulls the `parseResponseHeaders` function out of `DS.RestAdapter`
and moves it to its own module.

The main reason for this was to make it easier to unit test in order to
document current behavior before working on fixing the
emberjs#4122
HeroicEric added a commit to HeroicEric/data that referenced this issue Feb 6, 2016
This pulls the `parseResponseHeaders` function out of `DS.RestAdapter`
and moves it to its own module.

The main reason for this was to make it easier to unit test in order to
document current behavior before working on fixing the
emberjs#4122
HeroicEric added a commit to HeroicEric/data that referenced this issue Feb 6, 2016
Fixes emberjs#4122

- Allows header field-value without preceding whitespace
- Removes leading/trailing whitespace from header field-names
- Removes leading/trailing whitespace from header field-values
HeroicEric added a commit to HeroicEric/data that referenced this issue Feb 6, 2016
Fixes emberjs#4122

- Allows header field-value without preceding whitespace
- Removes leading/trailing whitespace from header field-names
- Removes leading/trailing whitespace from header field-values
- Moves `parseResponseHeaders` function out of `DS.RestAdapter` to its
  own module

The main reason for moving to a module was to make it easier to unit
test in order to document current behavior before making the fix. Let me
know if this is undesirable.
HeroicEric added a commit to HeroicEric/data that referenced this issue Feb 6, 2016
Fixes emberjs#4122

- Allows header field-value without preceding whitespace
- Removes leading/trailing whitespace from header field-names
- Removes leading/trailing whitespace from header field-values
- Moves `parseResponseHeaders` function out of `DS.RestAdapter` to its
  own module

The main reason for moving to a module was to make it easier to unit
test in order to document current behavior before making the fix. Let me
know if this is undesirable.
bmac pushed a commit that referenced this issue Feb 21, 2016
Fixes #4122

- Allows header field-value without preceding whitespace
- Removes leading/trailing whitespace from header field-names
- Removes leading/trailing whitespace from header field-values
- Moves `parseResponseHeaders` function out of `DS.RestAdapter` to its
  own module

The main reason for moving to a module was to make it easier to unit
test in order to document current behavior before making the fix. Let me
know if this is undesirable.

(cherry picked from commit dce22e3)
@runspired runspired added 🏷️ bug This PR primarily fixes a reported issue and removed Bug labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bug This PR primarily fixes a reported issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants