Closed Bug 1392220 Opened 7 years ago Closed 7 years ago

Fetch: data: URL HEAD request should result in empty response body

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: annevk, Assigned: wisniewskit)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Test: http://w3c-test.org/XMLHttpRequest/data-uri.htm

Updated in: https://github.com/w3c/web-platform-tests/pull/6923

Even if Fetch initially ends up creating a response with a body, main fetch step 18 sets it to null again. This is my bad since it's likely you used to pass this.
Blocks: xhr
I have a work-in-progress patch which fix this issue in the XHR code, but it causes 2 service worker mochitest failures [1]:

>dom/workers/test/serviceworkers/test_fetch_event.html
>failed | HEAD load should have synthesized response
>failed | Fetch test on worker: HEAD load should have synthesized response

Anne, this looks to me like the test is just incorrect in the same way that the WPT was. Do you agree, or does this warrant further investigation?

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=d193a7ff0058115d357c8dde64d0bc099343d8e4
Flags: needinfo?(annevk)
Assuming that's only about the response body (haven't looked at the test), yes.
Flags: needinfo?(annevk)
Priority: -- → P2
I've posted my patch for review (with a fix for that last test). Try seems fine (only unrelated intermittents): https://treeherder.mozilla.org/#/jobs?repo=try&revision=92792b3df7b1da67044d153e71fa9290e616baa9
Comment on attachment 8906316 [details]
Bug 1392220 - do not parse or return body for XHRs with HEAD or CONNECT method;

https://reviewboard.mozilla.org/r/178050/#review183182

I don't think I'm allow to review this, but this generally looks okay. I think Necko already handles this for HTTP, so I guess you have to add it explicitly again here due to other URL schemes?
Attachment #8906316 - Flags: review?(annevk)
Comment on attachment 8906316 [details]
Bug 1392220 - do not parse or return body for XHRs with HEAD or CONNECT method;

https://reviewboard.mozilla.org/r/178050/#review183248
Attachment #8906316 - Flags: review?(amarchesini) → review+
Thanks guys. Sorry Anne, I think I accidentally added your name into the reviewer list for this one. Thanks anyway! :S

A try run only shows unrelated intermittents: https://treeherder.mozilla.org/#/jobs?repo=try&revision=746812e713cf

Requesting check-in.
Keywords: checkin-needed
Assignee: nobody → wisniewskit
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3ad200ac1986
do not parse or return body for XHRs with HEAD or CONNECT method; r=baku
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3ad200ac1986
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.