fix(eventsource): set use-URL-credentials flag#5475
Open
Ram-blip wants to merge 1 commit into
Open
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 #5475 +/- ##
=======================================
Coverage 93.46% 93.46%
=======================================
Files 110 110
Lines 37124 37124
=======================================
Hits 34698 34698
Misses 2426 2426 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KhafraDev
requested changes
Jul 1, 2026
KhafraDev
left a comment
Member
There was a problem hiding this comment.
the test is completely useless... what is it testing?
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: truetomakeRequest(), but Undici storesuseCredentialsanduseURLCredentialsas separate fields. The Fetch authentication logic consumesuseURLCredentials, so the intended flag was not being set.WebSocket already uses
useURLCredentials: truefor the same internal request flag.Specification: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request
Changes
Changed
useCredentials: truetouseURLCredentials: trueincreatePotentialCORSRequest().Added unit coverage for both EventSource CORS states:
anonymous:corsmode withsame-origincredentialsuse-credentials:corsmode withincludecredentialsThe test also verifies
useURLCredentials,destination,urlList, andurl.Features
N/A
Bug Fixes
Fixes EventSource request creation so the use-URL-credentials flag is set on the internal Fetch request.
Breaking Changes and Deprecations
N/A
Status
Testing