-
Notifications
You must be signed in to change notification settings - Fork 14
fix: credentials for multipart for cross-origin #2361
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes issues with sending credentials for multipart requests across origins by introducing explicit handling of the credentials flag in the streaming API.
- Added a withCredentials field to the StreamingAPI class.
- Updated the constructor to initialize withCredentials from options.config.
- Modified the streamQuery method to include a credentials property based on withCredentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables sending credentials on cross-origin multipart streaming requests by honoring the withCredentials
flag from the Axios wrapper options.
- Import
AxiosWrapperOptions
and storewithCredentials
inStreamingAPI
- Pass the appropriate
credentials
value (include
orsame-origin
) in the fetch options
Comments suppressed due to low confidence (1)
src/services/api/streaming.ts:76
- Add unit tests to verify that the credentials option is correctly set to 'include' when withCredentials is true and 'same-origin' when false or undefined.
credentials: this.withCredentials ? 'include' : 'same-origin',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes cross-origin behavior for multipart requests by dynamically setting the credentials field based on axios default settings.
- Injects a credentials option into the fetch request in the StreamingAPI class.
- Ensures that the request uses 'include' when axios is configured with withCredentials.
Closes #2360
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: ✅
Current: 83.65 MB | Main: 83.65 MB
Diff: +0.21 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information