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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp

Issue 2566503002: Adds HTTP check to PresentationRequest creation. (Closed)
Patch Set: Updates browser test. Created 3 years, 11 months 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/presentation/PresentationRequest.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
index 4da9bf0140fbdf5c812882a35fdf014531c36a8d..29fc7a518b3d60011ba066d7d11687b26a0453b3 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
@@ -84,7 +84,8 @@ PresentationRequest* PresentationRequest::create(
for (size_t i = 0; i < urls.size(); ++i) {
const KURL& parsedUrl = KURL(executionContext->url(), urls[i]);
- if (!parsedUrl.isValid() || parsedUrl.protocolIsAbout()) {
+ if (!parsedUrl.isValid() ||
+ !(parsedUrl.protocolIsInHTTPFamily() || parsedUrl.protocolIs("cast"))) {
exceptionState.throwDOMException(
SyntaxError, "'" + urls[i] + "' can't be resolved to a valid URL.");
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698