[Blink/Network] Allow extensions to set Origin header in fetch requests [chromium/src : main]

0 views
Skip to first unread message

Justin Lulejian (Gerrit)

unread,
Feb 25, 2026, 4:21:47 PM (6 days ago) Feb 25
to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
Attention needed from Devlin Cronin

Justin Lulejian added 2 comments

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Justin Lulejian . resolved

Hi Devlin! Could you review the .*extensions.* changes and overall approach? I scoped this down to just the Origin header since that was the only header mentioned in the proposal. We could unrestrict this in the future, but it seemed better to allowlist headers as-needed at first.

File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/test_extension/user_script.js
Line 4, Patchset 12:
Justin Lulejian . resolved

Note: This script duplicates logic from `../fetch_common_tests.js`. IIUC user scripts cannot import other scripts so we have to duplicate it?

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
Gerrit-Change-Number: 7590435
Gerrit-PatchSet: 13
Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Wed, 25 Feb 2026 21:21:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
Feb 25, 2026, 6:28:24 PM (6 days ago) Feb 25
to Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
Attention needed from Justin Lulejian

Devlin Cronin added 11 comments

Patchset-level comments
Devlin Cronin . resolved

Thanks, Justin! General approach LG.

File chrome/browser/extensions/fetch_apitest.cc
Line 748, Patchset 13 (Latest): ResultCatcher content_script_catcher;
Devlin Cronin . unresolved

nit: user script, not content script

File chrome/browser/extensions/service_worker_apitest.cc
Line 1365, Patchset 13 (Parent):class ServiceWorkerFetchTest : public ServiceWorkerTest,
Devlin Cronin . unresolved

nit: can you move these in a precursor CL so that one CL is just copy-paste, and it's easier to tell what's new in this CL?

File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/fetch_common_tests.js
Line 12, Patchset 13 (Latest): await new Promise((resolve) => chrome.test.getConfig(resolve));
Devlin Cronin . unresolved

nit: since we're here, this can be simplified to just `const config = await chrome.test.getConfig()`. We allow promises in all contexts

Line 16, Patchset 13 (Latest): try {
Devlin Cronin . unresolved

nit: no need to wrap in a try-catch. The test infrastructure will throw an error if an exception is thrown (here and below)

Line 34, Patchset 13 (Latest): await new Promise((resolve) => chrome.test.getConfig(resolve));
Devlin Cronin . unresolved

nit: cache this above, i.e. above all tests have

```
let config;
```

and then in the first test:
```
config = ...;
```

that way, we don't have to refetch.

Line 36, Patchset 13 (Latest): config.testServer.port}/fetch/fetch_forbidden.html?test=fetchAndSet`;
Devlin Cronin . unresolved

nit: maybe extract to a getUrl() helper method?

Line 43, Patchset 13 (Latest): // https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header
Devlin Cronin . unresolved

nit:expand to note that this should still succeed, and silently drop the header

File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/test_extension/content_script.js
Line 6, Patchset 13 (Latest): if (config.customArg !== 'run_content_script_tests') {
Devlin Cronin . unresolved

instead of this, could we use different hosts or paths for the user script and content script? e.g., inject the content script on content-scripts.test and the user script on user-scripts.test, and then we only ever inject one of them.

File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/test_extension/user_script.js
Justin Lulejian . resolved

Note: This script duplicates logic from `../fetch_common_tests.js`. IIUC user scripts cannot import other scripts so we have to duplicate it?

Devlin Cronin

yeah, that's pretty much correct. There could be some workarounds, but not worth it for the relatively small amount here.

File third_party/blink/renderer/core/fetch/headers.cc
Line 266, Patchset 13 (Latest): // request header, return. The user agent may choose to skip this step and
Devlin Cronin . unresolved

I'll leave it for blink owners to decide, but this hasn't _yet_ been accepted into the fetch spec.

I'd put it as a non-quoted comment below.

Open in Gerrit

Related details

Attention is currently required from:
  • Justin Lulejian
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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
    Gerrit-Change-Number: 7590435
    Gerrit-PatchSet: 13
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Comment-Date: Wed, 25 Feb 2026 23:28:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Justin Lulejian <jlul...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Lulejian (Gerrit)

    unread,
    Feb 26, 2026, 6:33:15 PM (5 days ago) Feb 26
    to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
    Attention needed from Devlin Cronin

    Justin Lulejian added 9 comments

    File chrome/browser/extensions/fetch_apitest.cc
    Line 748, Patchset 13: ResultCatcher content_script_catcher;
    Devlin Cronin . resolved

    nit: user script, not content script

    Justin Lulejian

    Done

    File chrome/browser/extensions/service_worker_apitest.cc
    Line 1365, Patchset 13 (Parent):class ServiceWorkerFetchTest : public ServiceWorkerTest,
    Devlin Cronin . resolved

    nit: can you move these in a precursor CL so that one CL is just copy-paste, and it's easier to tell what's new in this CL?

    Justin Lulejian

    Done as [Split out tests moving and fix comments/expectations (7614727)](https://crrev.com/c/7614727)

    File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/fetch_common_tests.js
    Line 12, Patchset 13: await new Promise((resolve) => chrome.test.getConfig(resolve));
    Devlin Cronin . resolved

    nit: since we're here, this can be simplified to just `const config = await chrome.test.getConfig()`. We allow promises in all contexts

    Justin Lulejian

    Done

    Line 16, Patchset 13: try {
    Devlin Cronin . resolved

    nit: no need to wrap in a try-catch. The test infrastructure will throw an error if an exception is thrown (here and below)

    Justin Lulejian

    Done

    Line 34, Patchset 13: await new Promise((resolve) => chrome.test.getConfig(resolve));
    Devlin Cronin . resolved

    nit: cache this above, i.e. above all tests have

    ```
    let config;
    ```

    and then in the first test:
    ```
    config = ...;
    ```

    that way, we don't have to refetch.

    Justin Lulejian

    Done

    Line 36, Patchset 13: config.testServer.port}/fetch/fetch_forbidden.html?test=fetchAndSet`;
    Devlin Cronin . resolved

    nit: maybe extract to a getUrl() helper method?

    nit:expand to note that this should still succeed, and silently drop the header

    Justin Lulejian

    Done

    File chrome/test/data/extensions/api_test/service_worker/worker_fetch_headers/test_extension/content_script.js
    Line 6, Patchset 13: if (config.customArg !== 'run_content_script_tests') {
    Devlin Cronin . resolved

    instead of this, could we use different hosts or paths for the user script and content script? e.g., inject the content script on content-scripts.test and the user script on user-scripts.test, and then we only ever inject one of them.

    Justin Lulejian

    split into separate .html files

    File third_party/blink/renderer/core/fetch/headers.cc
    Line 266, Patchset 13: // request header, return. The user agent may choose to skip this step and
    Devlin Cronin . resolved

    I'll leave it for blink owners to decide, but this hasn't _yet_ been accepted into the fetch spec.

    I'd put it as a non-quoted comment below.

    Justin Lulejian

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
      Gerrit-Change-Number: 7590435
      Gerrit-PatchSet: 16
      Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
      Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Comment-Date: Thu, 26 Feb 2026 23:33:09 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Devlin Cronin (Gerrit)

      unread,
      Feb 27, 2026, 3:57:41 PM (4 days ago) Feb 27
      to Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
      Attention needed from Justin Lulejian

      Devlin Cronin voted and added 4 comments

      Votes added by Devlin Cronin

      Code-Review+1

      4 comments

      Patchset-level comments
      File-level comment, Patchset 19 (Latest):
      Devlin Cronin . resolved

      LGTM; thank you, Justin!

      File chrome/browser/extensions/fetch_apitest.cc
      Line 553, Patchset 19 (Latest): // Confirm if headers that are forbidden are allowed on a POST request.
      Devlin Cronin . unresolved

      (based on feature state)

      Line 555, Patchset 19 (Latest): // custom header when it normally calculates the Origin for POST.
      Devlin Cronin . unresolved

      nit: throughout: I don't think I'd call this a "custom header", per se -- rather, it's a set value for the Origin header. Custom headers usually refer to non-specified headers, like MyHeaderThatICreated.

      File chrome/test/data/extensions/api_test/fetch/fetch_headers/set_headers_test_extension/user_script.js
      Line 39, Patchset 19 (Latest): chrome.test.succeed();
      Devlin Cronin . unresolved

      nit: if we use chrome.test.succeed(), we should wrap this in a runTests() -- even if it just has one test in it. That will also ensure we send a failure if there's an exception thrown.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Justin Lulejian
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • 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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
        Gerrit-Change-Number: 7590435
        Gerrit-PatchSet: 19
        Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Comment-Date: Fri, 27 Feb 2026 20:57:33 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Justin Lulejian (Gerrit)

        unread,
        Feb 27, 2026, 4:56:08 PM (4 days ago) Feb 27
        to Dave Tapuska, Kenichi Ishibashi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
        Attention needed from Dave Tapuska and Kenichi Ishibashi

        Justin Lulejian voted and added 4 comments

        Votes added by Justin Lulejian

        Auto-Submit+1

        4 comments

        Patchset-level comments
        File-level comment, Patchset 21 (Latest):
        Justin Lulejian . resolved

        Hi Dave! Could you review the third_party/blink/.* changes please?

        Hi Kenichi! Would you be able to review the services/network/.* changes please? If not could you add the most appropriate reviewer?

        For reference, here is the W3C proposal for this: https://docs.google.com/document/d/1R3ndiV4iMu2QaqbbkFbP9GO27oKi8gXmmfrSU4HUMj0/edit?usp=sharing

        File chrome/browser/extensions/fetch_apitest.cc
        Line 553, Patchset 19: // Confirm if headers that are forbidden are allowed on a POST request.
        Devlin Cronin . resolved

        (based on feature state)

        Justin Lulejian

        Done here and elsewhere.

        Line 555, Patchset 19: // custom header when it normally calculates the Origin for POST.
        Devlin Cronin . resolved

        nit: throughout: I don't think I'd call this a "custom header", per se -- rather, it's a set value for the Origin header. Custom headers usually refer to non-specified headers, like MyHeaderThatICreated.

        Justin Lulejian

        Done

        File chrome/test/data/extensions/api_test/fetch/fetch_headers/set_headers_test_extension/user_script.js
        Line 39, Patchset 19: chrome.test.succeed();
        Devlin Cronin . resolved

        nit: if we use chrome.test.succeed(), we should wrap this in a runTests() -- even if it just has one test in it. That will also ensure we send a failure if there's an exception thrown.

        Justin Lulejian

        Decided to switch to chrome.test.sendMessage() to make it more explicit that the test assertions aren't happening here, this is just driving the test and the C++ side of the test is doing the assertions.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dave Tapuska
        • Kenichi Ishibashi
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
          Gerrit-Change-Number: 7590435
          Gerrit-PatchSet: 21
          Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
          Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
          Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Fri, 27 Feb 2026 21:56:03 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Kenichi Ishibashi (Gerrit)

          unread,
          Mar 1, 2026, 8:44:49 PM (2 days ago) Mar 1
          to Justin Lulejian, Takashi Toyoshima, Dave Tapuska, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
          Attention needed from Dave Tapuska, Justin Lulejian and Takashi Toyoshima

          Kenichi Ishibashi added 1 comment

          Patchset-level comments
          Kenichi Ishibashi . resolved

          toyoshim@: Could you take a look?

          I suppose this is fine, but I want to double check with toyoshim@.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Justin Lulejian
          • Takashi Toyoshima
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
          Gerrit-Change-Number: 7590435
          Gerrit-PatchSet: 21
          Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
          Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
          Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Comment-Date: Mon, 02 Mar 2026 01:44:39 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Takashi Toyoshima (Gerrit)

          unread,
          Mar 2, 2026, 1:22:17 AM (yesterday) Mar 2
          to Justin Lulejian, Dave Tapuska, Kenichi Ishibashi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
          Attention needed from Dave Tapuska and Justin Lulejian

          Takashi Toyoshima added 4 comments

          Patchset-level comments
          Takashi Toyoshima . resolved

          Change and direction looks good.
          Just one request on code is a file location to follow the code structure and layring.
          Also another nit is a request to add a clear comment about the secure design.

          File services/network/cors/cors_url_loader.cc
          Line 898, Patchset 21 (Latest): if (should_include_origin_header()) {
          Takashi Toyoshima . unresolved

          Can you have a short comment on this to clarify why this is safe. e.g
          ```
          // If the Origin header is given, check if the initiator has a permission to
          // override unsafe headers for the target URL. This Allowlist is given from
          // a trustworthy process per factory, and safe to trust as a secondary security
          // check here in the network service.
          ```

          Line 899, Patchset 21 (Latest): bool has_custom_origin_header_with_bypass =
          Takashi Toyoshima . unresolved

          nit: const bool

          File services/network/public/cpp/cors/cors.h
          Line 95, Patchset 21 (Latest):bool ShouldAllowUnsafeHeaders(
          Takashi Toyoshima . unresolved

          If you call this only inside the network service, this doesn't need to be in the public/cpp. Probably, //services/network/cors/cors_util.cc would be a better place.

          This public/cpp is used to place a C++ common code that may be also used in the browser process or blink/platform layer.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dave Tapuska
          • Justin Lulejian
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
            Gerrit-Change-Number: 7590435
            Gerrit-PatchSet: 21
            Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
            Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
            Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
            Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
            Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
            Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
            Gerrit-Comment-Date: Mon, 02 Mar 2026 06:22:09 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Justin Lulejian (Gerrit)

            unread,
            Mar 2, 2026, 2:50:40 PM (21 hours ago) Mar 2
            to Dave Tapuska, Takashi Toyoshima, Kenichi Ishibashi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
            Attention needed from Takashi Toyoshima

            Justin Lulejian voted and added 4 comments

            Votes added by Justin Lulejian

            Auto-Submit+1

            4 comments

            Patchset-level comments
            File-level comment, Patchset 22 (Latest):
            Justin Lulejian . resolved

            With Takashi added as reviewer I'll move Dave to CC to reduce reviewer load on this commit.

            File services/network/cors/cors_url_loader.cc
            Line 898, Patchset 21: if (should_include_origin_header()) {
            Takashi Toyoshima . resolved

            Can you have a short comment on this to clarify why this is safe. e.g
            ```
            // If the Origin header is given, check if the initiator has a permission to
            // override unsafe headers for the target URL. This Allowlist is given from
            // a trustworthy process per factory, and safe to trust as a secondary security
            // check here in the network service.
            ```

            Justin Lulejian

            Done

            Line 899, Patchset 21: bool has_custom_origin_header_with_bypass =
            Takashi Toyoshima . resolved

            nit: const bool

            Justin Lulejian

            Done

            File services/network/public/cpp/cors/cors.h
            Line 95, Patchset 21:bool ShouldAllowUnsafeHeaders(
            Takashi Toyoshima . resolved

            If you call this only inside the network service, this doesn't need to be in the public/cpp. Probably, //services/network/cors/cors_util.cc would be a better place.

            This public/cpp is used to place a C++ common code that may be also used in the browser process or blink/platform layer.

            Justin Lulejian

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Takashi Toyoshima
            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: Ic484fdc7cb37c6201d6d82e52df44b1f12912e30
              Gerrit-Change-Number: 7590435
              Gerrit-PatchSet: 22
              Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
              Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
              Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
              Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
              Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-Comment-Date: Mon, 02 Mar 2026 19:50:35 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Devlin Cronin (Gerrit)

              unread,
              Mar 2, 2026, 2:51:19 PM (21 hours ago) Mar 2
              to Justin Lulejian, Dave Tapuska, Takashi Toyoshima, Kenichi Ishibashi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, network-ser...@chromium.org
              Attention needed from Takashi Toyoshima

              Devlin Cronin added 1 comment

              Patchset-level comments
              Devlin Cronin . resolved

              Looks like gerrit was over-eager in re-adding me -- mind pinging when this is ready for a re-stamp?

              Gerrit-Comment-Date: Mon, 02 Mar 2026 19:51:12 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages