Closed
Bug 1109574
Opened 10 years ago
Closed 10 years ago
[Fetch] Passing Request object (whose body is null) to Request() constructor shouldn't set used flag for passing Request object
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: crimsteam, Assigned: nsm)
References
Details
Attachments
(1 file)
3.74 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 Build ID: 20141125180439 Steps to reproduce: When we use Request() constructor and not set 'body' member in second argument, then request's body for new Request object is null (initial value). Passing this new Request object to Request() constructor shouldn't set his used flag (because body is null), what we see in first step in algo: https://fetch.spec.whatwg.org/#dom-request The same applies to fetch() method when we pass Request object where request's body for this object is null, because this algorithm used Request() constructor algorithm (step 2.): https://fetch.spec.whatwg.org/#dom-global-fetch Now Firefox, for both case: Request() constructor and fetch() method, set used flag for passing Request object. Looks like there is no null for body and probably using empty byte sequence. Small test: <script type = "text/javascript"> var request1 = new Request(""); document.write("request1.bodyUsed: " + request1.bodyUsed + "<br>"); // false // This set used flag for request1 (it's not correct per spec) var request2 = new Request(request1); document.write("request1.bodyUsed: " + request1.bodyUsed + "<br>"); // true // This throw because used flag for request1 is set try{ new Request(request1); } catch(e){ document.write(e); // TypeError: Request body has already been consumed. } </script>
Comment 1•10 years ago
|
||
Thanks. This was a change to the spec and we need to catch up to it. The code in our project branch, maple, is here: https://hg.mozilla.org/projects/maple/file/ba71ba81175f/dom/fetch/Request.cpp#l66 We'll fix it there first and merge to m-c in the coming weeks. (We have a lot of changes over on maple.) Incidentally, if you want to test with maple, you can grab a build from one of these dirs: http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/maple-win32/latest/ http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/maple-macosx64/latest/ http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/maple-linux/latest/
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8540622 -
Flags: review?(bkelly)
Reporter | ||
Comment 3•10 years ago
|
||
Hmm I check this maple version but get a lot of crash when try use fetch() method (win32). Which version contains the latest changes for Fetch, standard nightly or nightly-maple?
Updated•10 years ago
|
Attachment #8540622 -
Flags: review?(bkelly) → review+
Comment 4•10 years ago
|
||
(In reply to Arkadiusz Michalski (Spirit) from comment #3) > Hmm I check this maple version but get a lot of crash when try use fetch() > method (win32). Which version contains the latest changes for Fetch, > standard nightly or nightly-maple? Maple has the latest patches applied, I believe. Can you write a new bug with the crash information? CC :nsm, :bkelly, and :baku. Thanks!
Reporter | ||
Comment 5•10 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1115214
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 6•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/beacba1d431a
https://hg.mozilla.org/mozilla-central/rev/beacba1d431a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
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
•