Bug 1247464 - Run CSP report URIs through the URL classifier. r=ckerschb

MozReview-Commit-ID: ERoZAbw1nbf
This commit is contained in:
Francois Marier 2016-02-11 17:36:13 -08:00
parent 7e3f410fb0
commit 9049fa458f

View File

@ -851,19 +851,26 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource,
} }
// try to create a new channel for every report-uri // try to create a new channel for every report-uri
nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI;
if (doc) { if (doc) {
rv = NS_NewChannel(getter_AddRefs(reportChannel), rv = NS_NewChannel(getter_AddRefs(reportChannel),
reportURI, reportURI,
doc, doc,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsIContentPolicy::TYPE_CSP_REPORT); nsIContentPolicy::TYPE_CSP_REPORT,
nullptr, // aLoadGroup
nullptr, // aCallbacks
loadFlags);
} }
else { else {
rv = NS_NewChannel(getter_AddRefs(reportChannel), rv = NS_NewChannel(getter_AddRefs(reportChannel),
reportURI, reportURI,
mLoadingPrincipal, mLoadingPrincipal,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsIContentPolicy::TYPE_CSP_REPORT); nsIContentPolicy::TYPE_CSP_REPORT,
nullptr, // aLoadGroup
nullptr, // aCallbacks
loadFlags);
} }
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {