Commit b992e3f0 authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Fix null header dereference on CorsURLLoader

Bug: 907073
Change-Id: I86883cc5326ba3a31a588fc1e1e3d7779cbf1df9
Reviewed-on: https://chromium-review.googlesource.com/c/1347960Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610355}
parent b7b1fc00
......@@ -502,6 +502,8 @@ void CorsURLLoader::SetCorsFlagIfNeeded() {
base::Optional<std::string> CorsURLLoader::GetHeaderString(
const ResourceResponseHead& response,
const std::string& header_name) {
if (!response.headers)
return base::nullopt;
std::string header_value;
if (!response.headers->GetNormalizedHeader(header_name, &header_value))
return base::nullopt;
......
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