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

Unified Diff: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 2619783002: CSP: Strip the fragment from reported URLs. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-strips-fragment.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 94b4a054dde9c8527e4c2f3cafc3af6e67a523d6..fbc7a8bf2f08ae45b329b5351a6cb60390941ecf 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -1026,10 +1026,10 @@ static void gatherSecurityPolicyViolationEventData(
// If this load was blocked via 'frame-ancestors', then the URL of
// |document| has not yet been initialized. In this case, we'll set both
// 'documentURI' and 'blockedURI' to the blocked document's URL.
- init.setDocumentURI(blockedURL.getString());
- init.setBlockedURI(blockedURL.getString());
+ init.setDocumentURI(blockedURL.strippedForUseAsReferrer());
elawrence 2017/01/09 16:34:41 In the stripURLForUseInReport() function immediate
Mike West 2017/02/23 08:41:19 For the `document-uri`, that's less of a concern,
+ init.setBlockedURI(blockedURL.strippedForUseAsReferrer());
} else {
- init.setDocumentURI(context->url().getString());
+ init.setDocumentURI(context->url().strippedForUseAsReferrer());
switch (violationType) {
case ContentSecurityPolicy::InlineViolation:
init.setBlockedURI("inline");
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-strips-fragment.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698