-
Notifications
You must be signed in to change notification settings - Fork 26.4k
fix(common): Don't include statusText in HttpErrorResponse.message, deprecate HttpResponseBase.statusText #58080
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
base: main
Are you sure you want to change the base?
Conversation
We'll need to update our golden files, for this please run Also please include a |
…eprecate HttpResponseBase.statusText Since HTTP/2, responses no longer contain a status text besides the status code, which caused our default value of 'OK' to be used in HttpErrorResponse.message. As discussed in angular#57580, we are opting to not change the default value to match the fetch spec (https://fetch.spec.whatwg.org/#concept-response-status-message), instead, we are deprecating the statusText field, and not using it in our own code. DEPRECATED: HttpResponseBase.statusText This field is usually populated with OK by default, and overwritten by what a remote HTTP server responds with on the status line. Since HTTP/2, we aren't guaranteed to have a value for this on the status line, meaning this value gets stuck at OK. If you need this field for display purposes, it is recommended to retrieve a selection from RFC9110 (or future RFCs) yourself. For other purposes, an HttpResponseCode enum is also provided at common/http. Fixes angular#23334
any updates on this PR ? |
@gorvk not from my end. All reque 8000 sted changes have been made so far, so it has just been sitting here, waiting for further feedback, approval or a close. |
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
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
Since HTTP/2, responses no longer contain a status text besides the status code, which caused our default value of 'OK' to be used in HttpErrorResponse.message. As discussed in #57580, we are opting to not change the default value to match the fetch spec (https://fetch.spec.whatwg.org/#concept-response-status-message), instead, we are deprecating the statusText field, and not using it in our own code.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #23334
What is the new behavior?
The
HttpResponseBase.statusText
field is deprecated, and it is not used inHttpErrorResponse.message
anymore.Does this PR introduce a breaking change?
Other information
This was discussed in #57580.