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

[BUGFIX] Lowercase header names in parseResponseHeaders #5489

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

jmar910
Copy link
Contributor

@jmar910 jmar910 commented Jun 14, 2018

Closes #4952.

Pretty sure I got all the places we rely on uppercased header names, like in generatedDetailedMessage 🤞

let field = header
.substring(0, j)
.trim()
.toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

Would you also mind adding the original "unlowercased" field name to the headers object so anyone's app that is relying the the current behavior continues to work?

@jmar910
Copy link
Contributor Author

jmar910 commented Jul 23, 2018

@bmac feedback addressed!

@runspired
Copy link
Contributor

@bmac I feel per-spec we should deprecate the non-lower-cased version in a follow-up, unsure how to implement and probably needs an RFC, otherwise mega +1 on this

@@ -92,7 +94,7 @@ test('ignores headers that do not contain a colon', function(assert) {

let headers = parseResponseHeaders(headersString);

assert.deepEqual(headers['Content-Encoding'], 'gzip', 'parses basic header pair');
assert.deepEqual(headers['content-encoding'], 'gzip', 'parses basic header pair');
assert.deepEqual(headers['apple'], 'pie', 'parses basic header pair');
assert.equal(Object.keys(headers).length, 2, 'only has the one valid header');
Copy link
Contributor

Choose a reason for hiding this comment

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

This assert's description is wrong (we had two and now we have three valid headers lol). The valid headers will be content-encoding Content-Encoding and apple

@jmar910
Copy link
Contributor Author

jmar910 commented Jul 24, 2018 via email

@jmar910
Copy link
Contributor Author

jmar910 commented Jul 30, 2018

Anddddd we're back, should be good now @runspired

@jmar910 jmar910 closed this Jul 31, 2018
@jmar910 jmar910 reopened this Jul 31, 2018
@runspired runspired merged commit 924fd6d into emberjs:master Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants