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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2794303002: Deprecate resource requests whose URLs contain raw newlines. (Closed)
Patch Set: Rebase. Created 3 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/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 15a360bdb226a5160d48071205357c46d9f58bf6..c363fef44b5a9033651548fd3563c23fde80e528 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -843,6 +843,18 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(
reportingPolicy))
return ResourceRequestBlockedReason::MixedContent;
+ if (url.whitespaceRemoved()) {
+ Deprecation::countDeprecation(
+ frame()->document(), UseCounter::CanRequestURLHTTPContainingNewline);
+ if (url.protocolIsInHTTPFamily()) {
+ if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled())
+ return ResourceRequestBlockedReason::Other;
+ } else {
+ UseCounter::count(frame()->document(),
+ UseCounter::CanRequestURLNonHTTPContainingNewline);
+ }
+ }
+
// Let the client have the final say into whether or not the load should
// proceed.
DocumentLoader* documentLoader = masterDocumentLoader();
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698