Closed
Bug 1059174
Opened 10 years ago
Closed 10 years ago
Allow ServiceWorkers over http on localhost
Categories
(Core :: DOM: Workers, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: jaffathecake, Assigned: baku)
References
()
Details
Attachments
(1 file)
1.61 KB,
patch
|
nsm
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36
Steps to reproduce:
navigator.serviceWorker.register(url) on a page hosted at http://localhost:3000/
Actual results:
SecurityError: The operation is insecure.
Expected results:
Registration allowed over http on localhost
Updated•10 years ago
|
Component: Untriaged → DOM: Workers
Product: Firefox → Core
Comment 1•10 years ago
|
||
This is similar to bug 1003991, but slightly different. Its unclear to me if we want both of these or just one.
Assignee | ||
Comment 2•10 years ago
|
||
Talking with bagder from the necko team, we both agreed that using the DNS was too much for this issue. This patch gives a reasonable way to manage localhost: It covers localhost, ::1, and 127.0.0.1.
Attachment #8482652 -
Flags: review?(nsm.nikhil)
Comment on attachment 8482652 [details] [diff] [review]
localhost.patch
Review of attachment 8482652 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/workers/ServiceWorkerManager.cpp
@@ +588,5 @@
> + if (NS_WARN_IF(result.Failed())) {
> + return result.ErrorCode();
> + }
> +
> + if (host == "127.0.0.1" || host == "localhost" || host == "::1") {
Could you use Equals()? == always stands out as 'oh this could be wrong' when literals are involved, and requires looking up to see that one of the operands is a nsAutoCString.
Attachment #8482652 -
Flags: review?(nsm.nikhil) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Yes, Equals() is better.
https://hg.mozilla.org/integration/mozilla-inbound/rev/cea25477ad0f
Comment 5•10 years ago
|
||
Assignee: nobody → amarchesini
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•