From 94ef4ac1a92438eb9e4e8c18c3b2121a90142f67 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Thu, 16 Jan 2025 09:11:55 +0000 Subject: [PATCH 1/4] Skip unnecessary checks when we have a preloaded response candidate in main fetch --- fetch.bs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/fetch.bs b/fetch.bs index 3a684a945..c6bbbdc21 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4480,19 +4480,25 @@ steps:
  • Let response be null. -

  • If request's local-URLs-only flag is set and request's - current URL is not local, then set response to a - network error. +

  • +

    If fetchParams's preloaded response candidate is null, then: +

      +
    1. If request's local-URLs-only flag is set and request's + current URL is not local, then set response to a + network error. -

    2. Run report Content Security Policy violations for request. +

    3. Run report Content Security Policy violations for request. -

    4. Upgrade request to a potentially trustworthy URL, if appropriate. +

    5. Upgrade request to a potentially trustworthy URL, if appropriate. -

    6. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. +

    7. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. -

    8. If should request be blocked due to a bad port, - should fetching request be blocked as mixed content, or - should request be blocked by Content Security Policy +

    9. If should request be blocked due to a bad port or + should request be blocked by Content Security Policy + returns blocked, then set response to a network error. +

    + +
  • If should fetching request be blocked as mixed content returns blocked, then set response to a network error.

  • If request's referrer policy is the empty string, then set From ba65a2c5e83b1a87ca7f4325fdc659af00ebbdad Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Fri, 17 Jan 2025 09:17:28 +0000 Subject: [PATCH 2/4] remove trailing whitespace --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index c6bbbdc21..6189e5161 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4497,7 +4497,7 @@ steps: should request be blocked by Content Security Policy returns blocked, then set response to a network error. - +

  • If should fetching request be blocked as mixed content returns blocked, then set response to a network error. From 5553c7dd42d9a65d047c493b2faaa7d742e12c77 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Tue, 21 Jan 2025 02:32:09 +0000 Subject: [PATCH 3/4] Address feedback --- fetch.bs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fetch.bs b/fetch.bs index 6189e5161..581648a25 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4481,24 +4481,26 @@ steps:

  • Let response be null.

  • -

    If fetchParams's preloaded response candidate is null, then: +

    If fetchParams's preloaded response candidate is null: +

      -
    1. If request's local-URLs-only flag is set and request's - current URL is not local, then set response to a - network error. +

    2. If request's local-URLs-only flag is set and request's + current URL is not local, then set response to a + network error. -

    3. Run report Content Security Policy violations for request. +

    4. Run report Content Security Policy violations for request. -

    5. Upgrade request to a potentially trustworthy URL, if appropriate. +

    6. Upgrade request to a potentially trustworthy URL, if appropriate. -

    7. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. +

    8. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. -

    9. If should request be blocked due to a bad port or - should request be blocked by Content Security Policy - returns blocked, then set response to a network error. +

    10. If should request be blocked due to a bad port or + should request be blocked by Content Security Policy + returns blocked, then set response to a network error.

    -
  • If should fetching request be blocked as mixed content +

  • If + should fetching request be blocked as mixed content returns blocked, then set response to a network error.

  • If request's referrer policy is the empty string, then set From 02993ffc26ecf5df4de4d92ec4855daaeaacff1c Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Tue, 21 Jan 2025 08:26:15 +0000 Subject: [PATCH 4/4] fix indentation --- fetch.bs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fetch.bs b/fetch.bs index 2c81659ab..8638898f1 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4478,23 +4478,23 @@ steps:

  • Let response be null.

  • -

    If fetchParams's preloaded response candidate is null: +

    If fetchParams's preloaded response candidate is null: -

      -
    1. If request's local-URLs-only flag is set and request's - current URL is not local, then set response to a - network error. +

        +
      1. If request's local-URLs-only flag is set and request's + current URL is not local, then set response to a + network error. -

      2. Run report Content Security Policy violations for request. +

      3. Run report Content Security Policy violations for request. -

      4. Upgrade request to a potentially trustworthy URL, if appropriate. +

      5. Upgrade request to a potentially trustworthy URL, if appropriate. -

      6. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. +

      7. Upgrade a mixed content request to a potentially trustworthy URL, if appropriate. -

      8. If should request be blocked due to a bad port or - should request be blocked by Content Security Policy - returns blocked, then set response to a network error. -

      +
    2. If should request be blocked due to a bad port or + should request be blocked by Content Security Policy + returns blocked, then set response to a network error. +

  • If should fetching request be blocked as mixed content