[net] Allow data: URL redirects in manual redirect mode [chromium/src : main]

0 views
Skip to first unread message

Adam Rice (Gerrit)

unread,
Nov 25, 2025, 1:11:26 PMNov 25
to Helmut Januschka, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Helmut Januschka

Adam Rice added 4 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Adam Rice . resolved

I'm not sure how much real-world impact this change will have. We may need to guard it behind a base::Feature,

Commit Message
Line 8, Patchset 3 (Latest):
Adam Rice . unresolved

The description should have more detail about the "why". If possible, refer to the relevant spec sections.

File net/url_request/url_request.h
Line 906, Patchset 3 (Latest): void set_is_fetch_redirect_mode_manual(bool is_manual) {
Adam Rice . unresolved

We usually avoid talking about web platform concepts in //net. It would be better to name the variable and accessors after the behaviour that they modify.

File net/url_request/url_request_http_job.cc
Line 1640, Patchset 3 (Latest): if (request_->is_fetch_redirect_mode_manual() && location.is_valid()) {
Adam Rice . unresolved

This doesn't actually guarantee we won't follow the redirect, only that someone has promised not to follow the redirect. We need some extra protection to make sure that the redirect really is not followed.

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
Gerrit-Change-Number: 7131545
Gerrit-PatchSet: 3
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Tue, 25 Nov 2025 18:10:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Helmut Januschka (Gerrit)

unread,
Dec 1, 2025, 2:56:08 AMDec 1
to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice

Helmut Januschka added 3 comments

Commit Message
Line 8, Patchset 3:
Adam Rice . resolved

The description should have more detail about the "why". If possible, refer to the relevant spec sections.

Helmut Januschka

Done

File net/url_request/url_request.h
Line 906, Patchset 3: void set_is_fetch_redirect_mode_manual(bool is_manual) {
Adam Rice . resolved

We usually avoid talking about web platform concepts in //net. It would be better to name the variable and accessors after the behaviour that they modify.

Helmut Januschka

Done

File net/url_request/url_request_http_job.cc
Line 1640, Patchset 3: if (request_->is_fetch_redirect_mode_manual() && location.is_valid()) {
Adam Rice . resolved

This doesn't actually guarantee we won't follow the redirect, only that someone has promised not to follow the redirect. We need some extra protection to make sure that the redirect really is not followed.

Helmut Januschka

we will return an opaque-redirect so this why it could considered safe, updated comment

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
    Gerrit-Change-Number: 7131545
    Gerrit-PatchSet: 4
    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Adam Rice <ri...@chromium.org>
    Gerrit-Comment-Date: Mon, 01 Dec 2025 07:55:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Adam Rice <ri...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    mmenke (Gerrit)

    unread,
    Dec 1, 2025, 10:54:55 PMDec 1
    to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
    Attention needed from Adam Rice and Helmut Januschka

    mmenke added 1 comment

    File net/url_request/url_request_http_job.cc
    Line 1599, Patchset 5 (Latest): // navigated to - an opaque-redirect response will be returned instead.

    if (request_->is_fetch_redirect_mode_manual() && location.is_valid()) {
    mmenke . unresolved

    Does this make any difference? As far as I can tell, this method always returns true. `request_->context()->job_factory()` should always be non-null, and it looks like there are no IsSafeRedirectTarget() overloads that return null.

    This safety checking is an artifact of when the network stack was in the browser process, and all URLs when through this code, as opposed to only HTTPS ones.

    If this does change behavior, please add unit tests. If not, let's leave well enough alone in this CL (happy to review a CL that removes this method and JobFactory::IsSafeRedirectTarget(), if you want).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Rice
    • Helmut Januschka
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • 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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
      Gerrit-Change-Number: 7131545
      Gerrit-PatchSet: 5
      Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
      Gerrit-CC: mmenke <mme...@chromium.org>
      Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
      Gerrit-Attention: Adam Rice <ri...@chromium.org>
      Gerrit-Comment-Date: Tue, 02 Dec 2025 03:54:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      mmenke (Gerrit)

      unread,
      Dec 1, 2025, 10:58:00 PMDec 1
      to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
      Attention needed from Adam Rice and Helmut Januschka

      mmenke added 1 comment

      File net/url_request/url_request_http_job.cc
      Line 1599, Patchset 5 (Latest): // navigated to - an opaque-redirect response will be returned instead.
      if (request_->is_fetch_redirect_mode_manual() && location.is_valid()) {
      mmenke . unresolved

      Does this make any difference? As far as I can tell, this method always returns true. `request_->context()->job_factory()` should always be non-null, and it looks like there are no IsSafeRedirectTarget() overloads that return null.

      This safety checking is an artifact of when the network stack was in the browser process, and all URLs when through this code, as opposed to only HTTPS ones.

      If this does change behavior, please add unit tests. If not, let's leave well enough alone in this CL (happy to review a CL that removes this method and JobFactory::IsSafeRedirectTarget(), if you want).

      mmenke

      Actually, there's an overload on iOS for Chrome URLs where it returns false, though not sure that one gets us anything.

      I do not think we want to modify the behavior for redirects from Chrome URLs on iOS, and the behavior everywhere else looks unchanged.

      Gerrit-Comment-Date: Tue, 02 Dec 2025 03:57:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: mmenke <mme...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Helmut Januschka (Gerrit)

      unread,
      Dec 2, 2025, 4:42:24 PMDec 2
      to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
      Attention needed from Adam Rice and mmenke

      Helmut Januschka added 1 comment

      File net/url_request/url_request_http_job.cc
      Line 1599, Patchset 5: // navigated to - an opaque-redirect response will be returned instead.

      if (request_->is_fetch_redirect_mode_manual() && location.is_valid()) {
      mmenke . resolved

      Does this make any difference? As far as I can tell, this method always returns true. `request_->context()->job_factory()` should always be non-null, and it looks like there are no IsSafeRedirectTarget() overloads that return null.

      This safety checking is an artifact of when the network stack was in the browser process, and all URLs when through this code, as opposed to only HTTPS ones.

      If this does change behavior, please add unit tests. If not, let's leave well enough alone in this CL (happy to review a CL that removes this method and JobFactory::IsSafeRedirectTarget(), if you want).

      mmenke

      Actually, there's an overload on iOS for Chrome URLs where it returns false, though not sure that one gets us anything.

      I do not think we want to modify the behavior for redirects from Chrome URLs on iOS, and the behavior everywhere else looks unchanged.

      Helmut Januschka

      thanks the if was rendundant added it on the trial and error approach, it is in fact not needed, uploaded new PS that removes it! thank you

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Rice
      • mmenke
      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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
        Gerrit-Change-Number: 7131545
        Gerrit-PatchSet: 6
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-CC: mmenke <mme...@chromium.org>
        Gerrit-Attention: mmenke <mme...@chromium.org>
        Gerrit-Attention: Adam Rice <ri...@chromium.org>
        Gerrit-Comment-Date: Tue, 02 Dec 2025 21:42:04 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        mmenke (Gerrit)

        unread,
        Dec 2, 2025, 4:49:25 PMDec 2
        to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
        Attention needed from Adam Rice and Helmut Januschka

        mmenke added 2 comments

        Patchset-level comments
        File-level comment, Patchset 6 (Latest):
        mmenke . resolved

        Note that I'll defer to Adam to actually sign off on the CL - I'm not familiar with blink code here, just net/ and services/network.

        File net/url_request/url_request.h
        Line 1271, Patchset 6 (Latest): bool is_fetch_redirect_mode_manual_ = false;
        mmenke . unresolved

        Changes here and to files in services/network/ should no longer be needed, either, I believe.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Adam Rice
        • Helmut Januschka
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • 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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
          Gerrit-Change-Number: 7131545
          Gerrit-PatchSet: 6
          Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
          Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
          Gerrit-CC: Nate Chapin <jap...@chromium.org>
          Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
          Gerrit-CC: mmenke <mme...@chromium.org>
          Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
          Gerrit-Attention: Adam Rice <ri...@chromium.org>
          Gerrit-Comment-Date: Tue, 02 Dec 2025 21:49:19 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Helmut Januschka (Gerrit)

          unread,
          Dec 22, 2025, 3:27:18 AM (yesterday) Dec 22
          to Helmut Januschka, Adam Rice, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
          Attention needed from Adam Rice and mmenke

          Helmut Januschka added 1 comment

          File net/url_request/url_request.h
          Line 1271, Patchset 6 (Latest): bool is_fetch_redirect_mode_manual_ = false;
          mmenke . resolved

          Changes here and to files in services/network/ should no longer be needed, either, I believe.

          Helmut Januschka

          I tested removing the changes to url_request.h and services/network/, keeping only the blink change. Unfortunately the tests still fail - the redirect is blocked at the network stack level in CorsURLLoader before it reaches blink.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Adam Rice
          • mmenke
          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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
            Gerrit-Change-Number: 7131545
            Gerrit-PatchSet: 6
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-CC: Nate Chapin <jap...@chromium.org>
            Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
            Gerrit-CC: mmenke <mme...@chromium.org>
            Gerrit-Attention: mmenke <mme...@chromium.org>
            Gerrit-Attention: Adam Rice <ri...@chromium.org>
            Gerrit-Comment-Date: Mon, 22 Dec 2025 08:26:58 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: mmenke <mme...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Adam Rice (Gerrit)

            unread,
            Dec 22, 2025, 5:18:38 PM (15 hours ago) Dec 22
            to Helmut Januschka, Yoav Weiss (@Shopify), Nate Chapin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, kinuko...@chromium.org, gavinp...@chromium.org, loading...@chromium.org, loading-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
            Attention needed from Helmut Januschka and mmenke

            Adam Rice added 2 comments

            Patchset-level comments
            Adam Rice . resolved

            Sorry for the delayed response.

            File services/network/url_loader_util.cc
            Line 676, Patchset 6 (Latest): url_request.set_is_fetch_redirect_mode_manual(request.redirect_mode ==
            Adam Rice . unresolved

            I can't find anything in this CL that reads the is_fetch_redirecto_mode_manual flag, so setting it shouldn't make any difference.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Helmut Januschka
            • mmenke
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • 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: If678bf4190e0c0630fe7036f514dab7ce8fa134e
              Gerrit-Change-Number: 7131545
              Gerrit-PatchSet: 6
              Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
              Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
              Gerrit-CC: Nate Chapin <jap...@chromium.org>
              Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
              Gerrit-CC: mmenke <mme...@chromium.org>
              Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
              Gerrit-Attention: mmenke <mme...@chromium.org>
              Gerrit-Comment-Date: Mon, 22 Dec 2025 22:18:17 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages