fix(eventsource): set use-URL-credentials flag#5489
Merged
KhafraDev merged 1 commit intoJul 2, 2026
Conversation
Signed-off-by: Ram-blip <ramcruze2000@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5489 +/- ##
=======================================
Coverage 93.45% 93.45%
=======================================
Files 110 110
Lines 37147 37147
=======================================
Hits 34716 34716
Misses 2431 2431 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KhafraDev
approved these changes
Jul 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to...
Fixes EventSource potential-CORS request creation so it sets the correct use-URL-credentials flag.
Rationale
The HTML potential-CORS request algorithm requires the returned request’s use-URL-credentials flag to be set.
createPotentialCORSRequest()previously passeduseCredentials, but Undici represents the use-URL-credentials flag using the separateuseURLCredentialsfield. The Fetch authentication path readsuseURLCredentials, so an EventSource URL containing credentials did not retry after a401authentication challenge.Specification:
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request
Changes
Changed EventSource’s potential-CORS request creation to pass
useURLCredentials: trueinstead ofuseCredentials: true.Added a behavioral regression test that verifies:
Authorization;Features
N/A
Bug Fixes
Fixes EventSource authentication with URL credentials after a
401 WWW-AuthenticateBasic challenge.Breaking Changes and Deprecations
N/A
Status