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

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

Issue 2895953002: Update dangling markup mitigations. (Closed)
Patch Set: Test. Created 3 years, 7 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/BaseFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp
index 748ae933ccb7700b068a49eff7a563c9c8567918..6913d5e8b47575cb2128361e8c91a833f9898e56 100644
--- a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp
@@ -290,20 +290,16 @@ ResourceRequestBlockedReason BaseFetchContext::CanRequestInternal(
}
// Check for mixed content. We do this second-to-last so that when folks block
- // mixed content with a CSP policy, they don't get a warning. They'll still
- // get a warning in the console about CSP blocking the load.
+ // mixed content via CSP, they don't get a mixed content warning, but a CSP
+ // warning instead.
if (ShouldBlockFetchByMixedContentCheck(resource_request, url,
reporting_policy))
return ResourceRequestBlockedReason::kMixedContent;
- if (url.WhitespaceRemoved()) {
+ if (url.PotentiallyDanglingMarkup() && url.ProtocolIsInHTTPFamily()) {
CountDeprecation(UseCounter::kCanRequestURLHTTPContainingNewline);
- if (url.ProtocolIsInHTTPFamily()) {
- if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled())
- return ResourceRequestBlockedReason::kOther;
- } else {
- CountUsage(UseCounter::kCanRequestURLNonHTTPContainingNewline);
- }
+ if (RuntimeEnabledFeatures::restrictCanRequestURLCharacterSetEnabled())
+ return ResourceRequestBlockedReason::kOther;
}
// Let the client have the final say into whether or not the load should

Powered by Google App Engine
This is Rietveld 408576698