mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: webRequest.onBeforeSendHeaders not being able to modify reserved headers (#49241)
* fix: `webRequest.onBeforeSendHeaders` not being able to modify reserved headers Co-authored-by: Samuel Attard <sattard@anthropic.com> * chore: add unit test for reserved header Co-authored-by: Samuel Attard <sattard@anthropic.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@anthropic.com>
This commit is contained in:
@@ -55,9 +55,9 @@ ProxyingURLLoaderFactory::InProgressRequest::InProgressRequest(
|
||||
proxied_loader_receiver_(this, std::move(loader_receiver)),
|
||||
target_client_(std::move(client)),
|
||||
current_response_(network::mojom::URLResponseHead::New()),
|
||||
// Always use "extraHeaders" mode to be compatible with old APIs, except
|
||||
// when the |request_id_| is zero, which is not supported in Chromium and
|
||||
// only happens in Electron when the request is started from net module.
|
||||
// Always use "extraHeaders" mode to be compatible with old APIs.
|
||||
// A non-zero request ID is required to use the TrustedHeaderClient path
|
||||
// which allows webRequest to modify headers like Proxy-Authorization.
|
||||
has_any_extra_headers_listeners_(network_service_request_id != 0) {
|
||||
// If there is a client error, clean up the request.
|
||||
target_client_.set_disconnect_handler(base::BindOnce(
|
||||
|
||||
Reference in New Issue
Block a user