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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.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/ServiceWorkerWindowClient.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index 34d45883c70e08368abf69aa2646c04ae614a992..95fb35f2c71743dec36d96cb1c4bdf3d67a1b91f 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -68,7 +68,7 @@ ScriptPromise ServiceWorkerWindowClient::navigate(ScriptState* scriptState, cons
ExecutionContext* context = scriptState->executionContext();
KURL parsedUrl = KURL(toWorkerGlobalScope(context)->location()->url(), url);
- if (!parsedUrl.isValid() || parsedUrl.protocolIsAbout()) {
+ 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