Commit 8e709936 authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Set requestor origin from referrer in WebAssociatedURLLoader

Some callers, notablly flash, with |grant_universal_access| want to
have an origin matching with referrer.

Bug: 935662
Change-Id: I99fc48266015d1a6ef611102f2cfbe2330ccc465
Reviewed-on: https://chromium-review.googlesource.com/c/1496125Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636746}
parent 280d700d
......@@ -395,8 +395,10 @@ void WebAssociatedURLLoaderImpl::LoadAsynchronously(
const auto mode = new_request.GetFetchRequestMode();
DCHECK(mode == network::mojom::FetchRequestMode::kNoCors ||
mode == network::mojom::FetchRequestMode::kNavigate);
scoped_refptr<SecurityOrigin> origin =
SecurityOrigin::CreateUniqueOpaque();
// Some callers, notablly flash, with |grant_universal_access| want to
// have an origin matching with referrer.
KURL referrer(request.HttpHeaderField(http_names::kReferer));
scoped_refptr<SecurityOrigin> origin = SecurityOrigin::Create(referrer);
origin->GrantUniversalAccess();
new_request.ToMutableResourceRequest().SetRequestorOrigin(origin);
}
......
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