Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp

Issue 1505023004: ServiceWorker: Early reject error if url is something wrong. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
index 4533f1f8995a1b0a63d470d3997f0532af84e761..0b581f05bc2628bdc4f6e428c1281d2c405d21c3 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
@@ -112,7 +112,7 @@ ScriptPromise ServiceWorkerClients::openWindow(ScriptState* scriptState, const S
ExecutionContext* context = scriptState->executionContext();
KURL parsedUrl = KURL(toWorkerGlobalScope(context)->location()->url(), url);
- if (!parsedUrl.isValid()) {
+ if (!parsedUrl.isValid() || !parsedUrl.protocolIsInHTTPFamily()) {
resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), "'" + url + "' is not a valid URL."));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698