Commit 47ce2c38 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

CSP: Null check if response_headers are present before parsing.

Bug: 759184
Change-Id: I13b092293ddfd0c78f2556452d4f4776591c3105
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1988918Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728787}
parent 90040dce
......@@ -1008,8 +1008,10 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
network::features::kOutOfBlinkFrameAncestors)) {
// Parse the Content-Security-Policy headers.
ContentSecurityPolicy policy;
if (policy.Parse(url_request_->url(), *url_request_->response_headers()))
if (url_request_->response_headers() &&
policy.Parse(url_request_->url(), *url_request_->response_headers())) {
response_->content_security_policy = policy.TakeContentSecurityPolicy();
}
}
if (base::FeatureList::IsEnabled(features::kCrossOriginIsolation)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment