Closed
Bug 1136200
Opened 10 years ago
Closed 10 years ago
Verify request type is no-cors if Service Worker returns opaque response.
Categories
(Core :: DOM: Workers, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file, 1 obsolete file)
No description provided.
Assignee | ||
Updated•10 years ago
|
Blocks: ServiceWorkers-v1
Assignee | ||
Updated•10 years ago
|
Mentor: nsm.nikhil
Whiteboard: [good first bug][lang=C++]
Assignee | ||
Comment 1•10 years ago
|
||
"no-cors" mode is used, for example, when a page has an <img> tag with src="http://someotherOrigin.com" where the image is displayed, or canvas where you may set the bitmap to another origin but then may no longer access the data.
If a service-worker returns an opaque Response it must have been in response to a Request with mode "no-cors".
Implement Section 4.2 step 2.2 - https://fetch.spec.whatwg.org/#http-fetch
1) In dom/fetch/ServiceWorkerEvents.cpp, in the ResolvedCallback(), after unwrapping the Response check that if the initiating Request (the implementer will have to add some way to get at the FetchEvent's Request, or just track what the Request's mode was) has mode no-cors and Response's Type() is not opaque, to just return.
2) Write a test case using mochitest in dom/workers/test/serviceworkers/fetch/fetch_tests.js to add a call to fetch("crossOriginURL", { mode: "no-cors" }). There are a couple of tests.
a) no-cors request, sw returns opaque response -> pass
b) "same-origin" request, sw returns opaque response -> error
Assignee | ||
Updated•10 years ago
|
Whiteboard: [good first bug][lang=C++]
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Mentor: nsm.nikhil
Assignee | ||
Comment 2•10 years ago
|
||
/r/5547 - Bug 1136200 - Verify request type is not no-cors if response is opaque
Pull down this commit:
hg pull review -r 17ea7e7061bf0814a0b3f13fc8b94b3679545af8
Attachment #8578876 -
Flags: review?(josh)
Comment 3•10 years ago
|
||
Comment on attachment 8578876 [details]
MozReview Request: bz://1136200/nsm
https://reviewboard.mozilla.org/r/5545/#review4551
::: dom/workers/ServiceWorkerEvents.cpp
(Diff revision 1)
> return;
This isn't a network error, is it? Doesn't this make the original request go through unintercepted?
Attachment #8578876 -
Flags: review?(josh)
Comment 4•10 years ago
|
||
Comment on attachment 8578876 [details]
MozReview Request: bz://1136200/nsm
https://reviewboard.mozilla.org/r/5545/#review4683
Ship It!
Attachment #8578876 -
Flags: review+
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Assignee | ||
Comment 9•9 years ago
|
||
Attachment #8578876 -
Attachment is obsolete: true
Attachment #8619575 -
Flags: review+
Assignee | ||
Comment 10•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•