-
Notifications
You must be signed in to change notification settings - Fork 26.4k
feat(http): add support for fetch mode and redirect options in HttpCl… #62315
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.
LGTM! Thank you!
reviewed-for: fw-general, public-api
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.
Reviewed-for: public-api
af458f9
to
93cc91a
Compare
…ient Add support for mode and redirect options in Angular's HttpClient based on fech provider to enable control CORS behavior and redirect handling
bb286ff
to
7fb51c6
Compare
This PR was merged into the repository by commit 8732244. The changes were merged into the following branches: main |
…n HttpClient (angular#62315)" This reverts commit 8732244.
…n HttpClient (angular#62315)" This reverts commit 8732244.
This commit adds support for the Fetch API's
mode
andredirect
options when usingHttpClient
with thewithFetch
provider.The change includes:
mode
andredirect
to theHttpRequestInit
interfaceFetchBackend
to pass the optionsMotivation / Use Cases
The
mode
andredirect
options are particularly useful for:mode controls the request's CORS policy ('cors', 'no-cors', 'same-origin'), helping manage security boundaries and cross-origin resource sharing.
redirect determines how redirects are handled ('follow', 'manual', 'error'), allowing developers to explicitly accept, reject, or handle redirections manually.
These options help ensure secure data access across origins, enforce strict network policies, and give developers more control over how external resources are handled.
Proposed Solution
mode
andredirect
to theHttpRequestInit
interfaceHttpRequest
classFetchBackend
to the native Fetch APIExamples of New Usage