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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1745083002: CORS-RFC1918: Force preflights for external requests in DocumentThreadableLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 4 years, 8 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/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index c8e19ff67dd7b76877a042ace84c8aa926ef0f41..b07106c22b218a5900469a429969d0923ff68bf7 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4976,6 +4976,12 @@ void Document::initSecurityContext(const DocumentInit& initializer)
// https://mikewest.github.io/cors-rfc1918/#csp).
if (initializer.isHostedInReservedIPRange()) {
setAddressSpace(getSecurityOrigin()->isLocalhost() ? WebAddressSpaceLocal : WebAddressSpacePrivate);
+ } else if (getSecurityOrigin()->isLocal()) {
+ // "Local" security origins (like 'file://...') are treated as having
+ // a local address space.
+ //
+ // TODO(mkwst): It's not entirely clear that this is a good idea.
+ setAddressSpace(WebAddressSpaceLocal);
} else {
setAddressSpace(WebAddressSpacePublic);
}

Powered by Google App Engine
This is Rietveld 408576698