Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick 5 fetch-related ladybird PRs #25320

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

sideshowbarker and others added 7 commits November 7, 2024 21:06
This change disables caching for 301, 302, 303, 307, and 308 responses.
This is just for now, ad-hoc — not adhering to any particular spec.
Fixes LadybirdBrowser/ladybird#863

(cherry picked from commit f735c464d3fe02ac43a1fa46c82ae9a3bb5de8b1)
Previously the code was checking for X-Method.

See:
 - http://wpt.live/fetch/api/basic/request-forbidden-headers.any.html
(cherry picked from commit 5151f94d393ca6e30a2ca7a34665e2cf6e1f5af9)
(cherry picked from commit 35047de1d8ce57bdab12d47044abff36145fca30)
This is defined as 64 KiB in the fetch spec.

See:
 - https://wpt.live/beacon/beacon-basic.https.window.html
(cherry picked from commit 17c1e99ce4b3a05d5f71e15513b2f1e4251047e2)
If a HTTP 401 response we get does not contain a `WWW-Authenticate`
header, we should not trigger the logic to ask the user for credentials
and retry the request.

This part is hinted at in a TODO / 'Needs testing' remark in the spec
but needs to be fleshed out. Raised an upstream issue to do so:

  whatwg/fetch#1766

This fixes login forms triggering an infinite fetch loop when providing
incorrect credentials.

Co-Authored-By: Victor Tran <[email protected]>
(cherry picked from commit e7984a77116d47fde150f81f6e18cae6aaa147ad)
This change causes HTTP status codes to be set on cached HTTP responses.

Otherwise, without this change, no status codes at all are set on cached
HTTP responses — which causes all cached responses to default to being
loaded/served with a 200 status code. And as a result of that, if the
cached response is from a 30x redirect, then without this change, when
that cached 30x response is loaded, we don’t follow the redirect —
because we see a 200 status, rather than the expected/original 30x.

Fixes LadybirdBrowser/ladybird#863

Note that this change also reverts the temporary workaround added in
LadybirdBrowser/ladybird@f735c464d3f
(LadybirdBrowser/ladybird#899).

(cherry picked from commit 23da1752b50568f2c49b1c63c2777ddffddaf6f5)
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 8, 2024
@nico nico merged commit 7959c42 into SerenityOS:master Nov 8, 2024
12 checks passed
@nico nico deleted the bulk_sync_1731031591 branch November 8, 2024 03:17
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants