DevTools: Fix Fetch.continueRequest for localhost cross-port redirects [chromium/src : main]

5 views
Skip to first unread message

Wang Neden (Gerrit)

unread,
Oct 26, 2025, 9:54:40 AMĀ (12 days ago)Ā Oct 26
to chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org

Wang Neden voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
Gerrit-Change-Number: 7081416
Gerrit-PatchSet: 1
Gerrit-Owner: Wang Neden <nede...@gmail.com>
Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
Gerrit-Comment-Date: Sun, 26 Oct 2025 13:54:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Wang Neden (Gerrit)

unread,
Oct 26, 2025, 10:53:27 AMĀ (12 days ago)Ā Oct 26
to Andrey Kosyakov, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org
Attention needed from Andrey Kosyakov

Wang Neden added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Wang Neden . resolved

Hi Andrey,

PTAL. Thanks in advance for your time on this.

This patch addresses a subtle logic mismatch between `net::SchemefulSite::IsSameSite` and the network stack's origin-based Referrer policy. This was causing `Fetch.continueRequest` to fail for cross-port redirects on localhost, a scenario frequently used by automation tools.

Let me know what you think of the fix.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
Gerrit-Change-Number: 7081416
Gerrit-PatchSet: 1
Gerrit-Owner: Wang Neden <nede...@gmail.com>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Sun, 26 Oct 2025 14:52:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wang Neden (Gerrit)

unread,
Nov 3, 2025, 3:00:18 AMĀ (4 days ago)Ā Nov 3
to Andrey Kosyakov, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org
Attention needed from Andrey Kosyakov

Wang Neden added 1 comment

Patchset-level comments
Wang Neden . resolved

Hi Andrey,

PTAL. Thanks in advance for your time on this.

This patch addresses a subtle logic mismatch between `net::SchemefulSite::IsSameSite` and the network stack's origin-based Referrer policy. This was causing `Fetch.continueRequest` to fail for cross-port redirects on localhost, a scenario frequently used by automation tools.

Let me know what you think of the fix.

Wang Neden

Gentle ping. No rush on this, just wanted to bring it back to your attention when you have a free moment. Thanks for your time!

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
Gerrit-Change-Number: 7081416
Gerrit-PatchSet: 1
Gerrit-Owner: Wang Neden <nede...@gmail.com>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Mon, 03 Nov 2025 07:59:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Wang Neden <nede...@gmail.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrey Kosyakov (Gerrit)

unread,
Nov 3, 2025, 3:04:18 PMĀ (4 days ago)Ā Nov 3
to Wang Neden, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org
Attention needed from Wang Neden

Andrey Kosyakov voted and added 1 comment

Votes added by Andrey Kosyakov

Code-Review+1

1 comment

Patchset-level comments
Andrey Kosyakov . resolved

Thanks, lgtm!

Open in Gerrit

Related details

Attention is currently required from:
  • Wang Neden
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
Gerrit-Change-Number: 7081416
Gerrit-PatchSet: 1
Gerrit-Owner: Wang Neden <nede...@gmail.com>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
Gerrit-Attention: Wang Neden <nede...@gmail.com>
Gerrit-Comment-Date: Mon, 03 Nov 2025 20:04:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Rudenko (Gerrit)

unread,
Nov 4, 2025, 3:28:25 AMĀ (3 days ago)Ā Nov 4
to Wang Neden, Andrey Kosyakov, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org
Attention needed from Wang Neden

Alex Rudenko voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Wang Neden
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
    Gerrit-Change-Number: 7081416
    Gerrit-PatchSet: 1
    Gerrit-Owner: Wang Neden <nede...@gmail.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
    Gerrit-Attention: Wang Neden <nede...@gmail.com>
    Gerrit-Comment-Date: Tue, 04 Nov 2025 08:28:09 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Nov 4, 2025, 4:38:36 AMĀ (3 days ago)Ā Nov 4
    to Wang Neden, Alex Rudenko, Andrey Kosyakov, AyeAye, chromium...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    DevTools: Fix Fetch.continueRequest for localhost cross-port redirects

    Using `Fetch.continueRequest` to redirect a request to a different
    port on localhost would fail with ERR_BLOCKED_BY_CLIENT if the
    initiator's URL contained a path or query string.

    The root cause was a logic mismatch within InterceptionJob. It used
    `net::SchemefulSite::IsSameSite` to decide whether to sanitize the
    Referrer for the new URL. This function considers different ports on
    localhost as same-site, so the Referrer was left unmodified.

    However, the lower-level URLRequest performs a stricter, origin-based
    Referrer-Policy check. It correctly identified the cross-port redirect
    as cross-origin and expected a sanitized Referrer. This mismatch caused
    the NetworkDelegate to block the request via
    `CancelURLRequestWithPolicyViolatingReferrerHeader`.

    This patch fixes the issue by replacing the `IsSameSite` check with
    a direct `url::Origin` comparison. This aligns the interception logic
    with the network stack, ensuring the Referrer is correctly handled for
    cross-origin redirects before the request is dispatched.
    Bug: 40922002
    Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
    Reviewed-by: Andrey Kosyakov <ca...@chromium.org>
    Commit-Queue: Alex Rudenko <alexr...@chromium.org>
    Auto-Submit: Wang Neden <nede...@gmail.com>
    Reviewed-by: Alex Rudenko <alexr...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1539861}
    Files:
    • M content/browser/devtools/devtools_url_loader_interceptor.cc
    • A third_party/blink/web_tests/http/tests/inspector-protocol/fetch/redirect-localhost-cross-port-expected.txt
    • A third_party/blink/web_tests/http/tests/inspector-protocol/fetch/redirect-localhost-cross-port.js
    Change size: M
    Delta: 3 files changed, 89 insertions(+), 3 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Alex Rudenko, +1 by Andrey Kosyakov
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie67621da287e4b4e63f97229c629667473d2be93
    Gerrit-Change-Number: 7081416
    Gerrit-PatchSet: 2
    Gerrit-Owner: Wang Neden <nede...@gmail.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Wang Neden <nede...@gmail.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages