| Index: Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| diff --git a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| index 5b1515350dc8efd08ec7373ccc8bfa0864a47617..2eb02c971e635bf41af7f573711233569a00c045 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
|
| @@ -145,7 +145,7 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| }
|
|
|
| KURL pageURL = KURL(KURL(), documentOrigin->toString());
|
| - if (!pageURL.protocolIsInHTTPFamily()) {
|
| + if (!SchemeRegistry::shouldAllowServiceWorkers(pageURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "Failed to register a ServiceWorker: The URL protocol of the current origin ('" + documentOrigin->toString() + "') is not supported."));
|
| return promise;
|
| }
|
| @@ -157,7 +157,7 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| resolver->reject(DOMException::create(SecurityError, "Failed to register a ServiceWorker: The origin of the provided scriptURL ('" + scriptOrigin->toString() + "') does not match the current origin ('" + documentOrigin->toString() + "')."));
|
| return promise;
|
| }
|
| - if (!scriptURL.protocolIsInHTTPFamily()) {
|
| + if (!SchemeRegistry::shouldAllowServiceWorkers(scriptURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "Failed to register a ServiceWorker: The URL protocol of the script ('" + scriptURL.string() + "') is not supported."));
|
| return promise;
|
| }
|
| @@ -174,7 +174,7 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS
|
| resolver->reject(DOMException::create(SecurityError, "Failed to register a ServiceWorker: The origin of the provided scope ('" + patternOrigin->toString() + "') does not match the current origin ('" + documentOrigin->toString() + "')."));
|
| return promise;
|
| }
|
| - if (!patternURL.protocolIsInHTTPFamily()) {
|
| + if (!SchemeRegistry::shouldAllowServiceWorkers(patternURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "Failed to register a ServiceWorker: The URL protocol of the scope ('" + patternURL.string() + "') is not supported."));
|
| return promise;
|
| }
|
| @@ -207,7 +207,7 @@ ScriptPromise ServiceWorkerContainer::getRegistration(ScriptState* scriptState,
|
| }
|
|
|
| KURL pageURL = KURL(KURL(), documentOrigin->toString());
|
| - if (!pageURL.protocolIsInHTTPFamily()) {
|
| + if (!SchemeRegistry::shouldAllowServiceWorkers(pageURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "Failed to get a ServiceWorkerRegistration: The URL protocol of the current origin ('" + documentOrigin->toString() + "') is not supported."));
|
| return promise;
|
| }
|
| @@ -243,7 +243,7 @@ ScriptPromise ServiceWorkerContainer::getRegistrations(ScriptState* scriptState)
|
| }
|
|
|
| KURL pageURL = KURL(KURL(), documentOrigin->toString());
|
| - if (!pageURL.protocolIsInHTTPFamily()) {
|
| + if (!SchemeRegistry::shouldAllowServiceWorkers(pageURL)) {
|
| resolver->reject(DOMException::create(SecurityError, "Failed to get ServiceWorkerRegistration objects: The URL protocol of the current origin ('" + documentOrigin->toString() + "') is not supported."));
|
| return promise;
|
| }
|
|
|