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

LibWeb: Check presence of WWW-Authenticate header in fetch response #1056

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

gmta
Copy link
Collaborator

@gmta gmta commented Aug 13, 2024

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.

PR #357 has a similar change but went stale-ish since last month, so this supersedes it. @vicr123 I'll gladly mention you as co-author if you'd like!

Copy link
Member

@tcl3 tcl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in commit message: needs to be fleshes out => needs to be fleshed out.

@gmta gmta force-pushed the libweb-fetching-401-header-check branch from 84f0e44 to be14aa8 Compare August 13, 2024 11:18
@gmta
Copy link
Collaborator Author

gmta commented Aug 13, 2024

Typo in commit message: needs to be fleshes out => needs to be fleshed out.

Ty, fixed!

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]>
@gmta gmta force-pushed the libweb-fetching-401-header-check branch from be14aa8 to 46f36e0 Compare August 13, 2024 12:12
@tcl3 tcl3 merged commit e7984a7 into LadybirdBrowser:master Aug 13, 2024
6 checks passed
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.

2 participants