Modifying the URL in OnBeforeResourceLoad causes an internal redirect response. In cases where the request is cross-origin and credentials mode is 'include' the redirect response must include the "Access-Control-Allow-Credentials" header, otherwise the request will be blocked.
This commit is contained in:
parent
367c6eb704
commit
99c27f57b1
|
@ -644,6 +644,12 @@ void InterceptedRequest::InterceptResponseReceived(
|
|||
network::cors::header_names::kAccessControlAllowOrigin, origin));
|
||||
}
|
||||
|
||||
if (request_.fetch_credentials_mode ==
|
||||
network::mojom::FetchCredentialsMode::kInclude) {
|
||||
head.headers->AddHeader(MakeHeader(
|
||||
network::cors::header_names::kAccessControlAllowCredentials, "true"));
|
||||
}
|
||||
|
||||
current_response_ = head;
|
||||
const net::RedirectInfo& redirect_info =
|
||||
MakeRedirectInfo(request_, head.headers.get(), request_.url, 0);
|
||||
|
|
Loading…
Reference in New Issue