Closed
Bug 1330297
Opened 7 years ago
Closed 7 years ago
Share code between Headers and setRequestHeader
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: annevk, Assigned: tt)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 7 obsolete files)
6.98 KB,
patch
|
tt
:
review+
|
Details | Diff | Splinter Review |
1.28 KB,
patch
|
tt
:
review+
|
Details | Diff | Splinter Review |
2.76 KB,
patch
|
tt
:
review+
|
Details | Diff | Splinter Review |
Headers fails on values 0x00, 0x0A, and 0x0D. setRequestHeader() only fails on 0x00. I suggest we make the latter fail on the same as Headers at the very least. See ongoing discussion at https://github.com/whatwg/fetch/issues/332.
Reporter | ||
Comment 1•7 years ago
|
||
https://github.com/w3c/web-platform-tests/pull/4525 has tests.
Blocks: xhr
Comment 2•7 years ago
|
||
Those tests don't actually check 0x0A or 0x0D behavior, right? In that the pull request there removes those tests?
Reporter | ||
Comment 3•7 years ago
|
||
It removes tests for \b and \x7F throwing, as those should no longer throw. It does not change \r and \n tests and adds a whole bunch of tests for both XMLHttpRequest and fetch(). Maybe you missed those? Note that https://github.com/w3c/web-platform-tests/pull/4583/files changes the added tests to perform less network fetches.
Comment 4•7 years ago
|
||
Er, yeah, I just misread the diff. :(
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 5•7 years ago
|
||
I found this problem when I investigated bug 1346313, so I would like to work on this bug. :p
Assignee: nobody → ttung
Assignee | ||
Comment 6•7 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
Assignee | ||
Comment 8•7 years ago
|
||
Current status: I just upload two patches to make sure they share the codes for triming HTTP whitespace. I'll take a look at the other part of SetRequestHeader() in xhr and Headers in fetch to see if there are any other things that can be shared.
Assignee | ||
Comment 9•7 years ago
|
||
Hi Anne, After reading comment[1] in github issue and spec[2], I have a question about stripping trailing/leading HTTP whitespace. I list my question as following: var headers = new Headers(); headers.set("foo", "b\r\nar"); // throw headers.set("foo", "\r\n"); // ok headers.set("foo", "\rbar\n"); // ok? but I'm not sure about it Does it mean we can have 0x0A/0x0D in the begining or ending of header's value since we strip the trailing/leading HTTP whitespace? [1] https://github.com/whatwg/fetch/issues/332#issuecomment-271879535 [2] https://fetch.spec.whatwg.org/#concept-header-value
Flags: needinfo?(annevk)
Reporter | ||
Comment 10•7 years ago
|
||
Yes, that is what it means. Any API that deals with header values will first run https://fetch.spec.whatwg.org/#concept-header-value-normalize and only then check it meets the other constraints before throwing.
Flags: needinfo?(annevk)
Assignee | ||
Comment 11•7 years ago
|
||
(In reply to Anne (:annevk) from comment #10) > Yes, that is what it means. Any API that deals with header values will first > run https://fetch.spec.whatwg.org/#concept-header-value-normalize and only > then check it meets the other constraints before throwing. Got it! Thanks for answering my question!
Assignee | ||
Comment 12•7 years ago
|
||
Attachment #8856386 -
Attachment is obsolete: true
Assignee | ||
Comment 13•7 years ago
|
||
Attachment #8856387 -
Attachment is obsolete: true
Assignee | ||
Comment 14•7 years ago
|
||
Assignee | ||
Comment 15•7 years ago
|
||
Sorry, previous one is wrong patch...
Attachment #8857853 -
Attachment is obsolete: true
Assignee | ||
Comment 16•7 years ago
|
||
Comment on attachment 8857848 [details] [diff] [review] P1: Strip leading or trailing HTTP whitespace for Header value to follow the spec and share code bewteen fetch and XHR. Hi Andrea, As comment 1, this bug is mainly to make fetch be able to trim leading/trailing HTTP whitespace and share the code with XHR. And, this patch is the implementation part. Could you help me to review this patch? Thanks!
Attachment #8857848 -
Flags: review?(amarchesini)
Assignee | ||
Comment 17•7 years ago
|
||
Comment on attachment 8857852 [details] [diff] [review] P2: Remove ini files to verify we can pass the test. This patch is for removing WPT tests.
Attachment #8857852 -
Flags: review?(amarchesini)
Assignee | ||
Comment 18•7 years ago
|
||
Comment on attachment 8857854 [details] [diff] [review] P3: Update mochitests to aligin with spec since we normalize value before checking and throwing. This patch is for modifying mochitests since the behavior is changed.
Attachment #8857854 -
Flags: review?(amarchesini)
Assignee | ||
Comment 19•7 years ago
|
||
(In reply to Tom Tung [:tt] from comment #17) > This patch is for removing WPT tests. s/removing/enabling/
Updated•7 years ago
|
Attachment #8857854 -
Flags: review?(amarchesini) → review+
Updated•7 years ago
|
Attachment #8857852 -
Flags: review?(amarchesini) → review+
Updated•7 years ago
|
Attachment #8857848 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 20•7 years ago
|
||
Thanks for the reviews!
Assignee | ||
Comment 21•7 years ago
|
||
Attachment #8857848 -
Attachment is obsolete: true
Attachment #8859420 -
Flags: review+
Assignee | ||
Comment 22•7 years ago
|
||
Attachment #8857852 -
Attachment is obsolete: true
Attachment #8859421 -
Flags: review+
Assignee | ||
Comment 23•7 years ago
|
||
Attachment #8857854 -
Attachment is obsolete: true
Attachment #8859422 -
Flags: review+
Assignee | ||
Comment 24•7 years ago
|
||
Previous updated patch is wrong...
Attachment #8859422 -
Attachment is obsolete: true
Attachment #8859423 -
Flags: review+
Assignee | ||
Comment 25•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=996827b6233c6470a9fffd4635388f7c0f9c914c
Assignee | ||
Updated•7 years ago
|
Attachment #8859420 -
Attachment description: Bug 1330297 - Part 1: Strip leading or trailing HTTP whitespace for Header value to follow the spec and share code bewteen fetch and XHR. r=baku → [Final] Bug 1330297 - Part 1: Strip leading or trailing HTTP whitespace for Header value to follow the spec and share code bewteen fetch and XHR. r=baku
Assignee | ||
Updated•7 years ago
|
Attachment #8859421 -
Attachment description: Bug 1330297 - Part 2: Remove ini files to verify we can pass the test. r=baku → [Final] Bug 1330297 - Part 2: Remove ini files to verify we can pass the test. r=baku
Assignee | ||
Updated•7 years ago
|
Attachment #8859423 -
Attachment description: Bug 1330297 - Part 3: Update mochitests to aligin with spec since we normalize value before checking and throwing. r=baku → [Final] Bug 1330297 - Part 3: Update mochitests to aligin with spec since we normalize value before checking and throwing. r=baku
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 26•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c72f2f5feaae Part 1: Strip leading or trailing HTTP whitespace for Header value to follow the spec and share code bewteen fetch and XHR. r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/e230df9fbec5 Part 2: Remove ini files to verify we can pass the test. r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/51df9eb41148 Part 3: Update mochitests to align with spec since we normalize value before checking and throwing. r=baku
Keywords: checkin-needed
Comment 27•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c72f2f5feaae https://hg.mozilla.org/mozilla-central/rev/e230df9fbec5 https://hg.mozilla.org/mozilla-central/rev/51df9eb41148
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•