-
Notifications
You must be signed in to change notification settings - Fork 27k
feat(http): Add redirected property to HttpResponse and HttpErrorResp… #62675
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
feat(http): Add redirected property to HttpResponse and HttpErrorResp… #62675
Conversation
|
@JeanMeche it's possible to try to run it again because failed the last time |
…onse Add support for the Fetch API's redirected property in HttpResponse and HttpErrorResponse when using HttpClient with the withFetch provider. The redirected property indicates whether the response was the result of an HTTP redirect, providing valuable information for security, debugging, and conditional logic.
a77a3ce to
7cd4b65
Compare
|
@JeanMeche I did a rebase, can I try to run the tests again? |
thePunderWoman
left a comment
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!
reviewed-for: fw-general, public-api
crisbeto
left a comment
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
|
This PR was merged into the repository by commit 0984b30. The changes were merged into the following branches: main |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
HttpResponse
redirectedProperty SupportThis commit adds support for the Fetch API's redirected property in HttpResponse and HttpErrorResponse when using HttpClient with the withFetch provider.
This change builds on the functionality introduced in #62315, which added support for passing the redirect option to the Fetch API. With redirects now configurable, exposing the redirected property provides developers with a way to determine if a response was the result of a redirect, further aligning HttpClient's behavior with the native Fetch API and enhancing observability of request flow
The Change Includes:
redirectedproperty toHttpResponseandHttpErrorResponseclassesFetchBackendto capture and forward theredirectedflag from the native fetch responseMotivation / Use Cases
The
redirectedproperty provides valuable information about whether the response was the result of a redirect:Examples of New Usage
Basic Redirect Detection
Conditional Logic Based on Redirects