Some fixes for common bugs in HttpClient#19958
Some fixes for common bugs in HttpClient#19958alxhub wants to merge 4 commits intoangular:masterfrom
Conversation
|
You can preview 62c7b98 at https://pr19958-62c7b98.ngbuilds.io/. |
packages/common/http/src/xhr.ts
Outdated
There was a problem hiding this comment.
I wonder if it is worth preserving the XSSI_PREFIX in this case 🤔
There was a problem hiding this comment.
Yes, done in a new commit.
|
You can preview 45006a5 at https://pr19958-45006a5.ngbuilds.io/. |
9b5c135 to
4fa1792
Compare
|
You can preview 4fa1792 at https://pr19958-4fa1792.ngbuilds.io/. |
|
When is it going to be merged? Without those fixes it's impossible to use most HTTP DELETE requests that returns empty body |
|
Hopefully this PR will get released as soon as possible, because the empty body parse issue is a real show stopper. |
|
When this fix will be released ??? |
|
FYI, in the meantime you can choose one of 3 options to workaround this:
|
|
@valkoun yeah, thanks, but it's a whole lot of stupid error-prone work, so I hope this fix will get into release ASAP |
|
Meanwhile I fixed the problem on the server side returning http status 204 for all void service method and so no more parsing error. |
|
Will this also get merged back to 4.4.6 or 7? |
|
When will it be released? |
|
@alxhub Will this be merged anytime soon? |
|
Yes, hopefully next week.
…On Sat, Nov 25, 2017, 7:55 AM Vinayak Patil ***@***.***> wrote:
@alxhub <https://github.com/alxhub> Will this be merged anytime soon?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19958 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD-1JYQglTdz-O3hJtlLgkfl3mY9hx6Uks5s57nzgaJpZM4QH_of>
.
|
Previously, HttpClient used the overly clever test "body || null" to determine when a body parameter was provided. This breaks when the valid bodies '0' or 'false' are provided. This change tests directly against 'undefined' to detect the presence of the body parameter, and thus correctly allows falsy values through. Fixes angular#19825. Fixes angular#19195.
An invalid "if" condition is always true, and is thus useless. This change removes it. No behavior changes. Fixes angular#19223.
Previously, XhrBackend would call JSON.parse('') if the response body was
empty (a 200 status code with content-length 0). This changes the XhrBackend
to attempt the JSON parse only if the response body is non-empty. Otherwise,
the body is left as null.
Fixes angular#18680.
Fixes angular#19413.
Fixes angular#19502.
Fixes angular#19555.
This changes XhrBackend to not strip the XSSI prefix from error text if such a prefix is present but the remaining body does not parse as JSON.
|
You can preview 4a4cb9f at https://pr19958-4a4cb9f.ngbuilds.io/. |
…ent (#19958) Previously, XhrBackend would call JSON.parse('') if the response body was empty (a 200 status code with content-length 0). This changes the XhrBackend to attempt the JSON parse only if the response body is non-empty. Otherwise, the body is left as null. Fixes #18680. Fixes #19413. Fixes #19502. Fixes #19555. PR Close #19958
This changes XhrBackend to not strip the XSSI prefix from error text if such a prefix is present but the remaining body does not parse as JSON. PR Close #19958
|
Any chance we can get a 4.4.7 release with this fix soon? |
Previously, HttpClient used the overly clever test "body || null" to determine when a body parameter was provided. This breaks when the valid bodies '0' or 'false' are provided. This change tests directly against 'undefined' to detect the presence of the body parameter, and thus correctly allows falsy values through. Fixes #19825. Fixes #19195. PR Close #19958
…ent (#19958) Previously, XhrBackend would call JSON.parse('') if the response body was empty (a 200 status code with content-length 0). This changes the XhrBackend to attempt the JSON parse only if the response body is non-empty. Otherwise, the body is left as null. Fixes #18680. Fixes #19413. Fixes #19502. Fixes #19555. PR Close #19958
This changes XhrBackend to not strip the XSSI prefix from error text if such a prefix is present but the remaining body does not parse as JSON. PR Close #19958
Previously, HttpClient used the overly clever test "body || null" to determine when a body parameter was provided. This breaks when the valid bodies '0' or 'false' are provided. This change tests directly against 'undefined' to detect the presence of the body parameter, and thus correctly allows falsy values through. Fixes angular#19825. Fixes angular#19195. PR Close angular#19958
An invalid "if" condition is always true, and is thus useless. This change removes it. No behavior changes. Fixes angular#19223. PR Close angular#19958
…ent (angular#19958) Previously, XhrBackend would call JSON.parse('') if the response body was empty (a 200 status code with content-length 0). This changes the XhrBackend to attempt the JSON parse only if the response body is non-empty. Otherwise, the body is left as null. Fixes angular#18680. Fixes angular#19413. Fixes angular#19502. Fixes angular#19555. PR Close angular#19958
…#19958) This changes XhrBackend to not strip the XSSI prefix from error text if such a prefix is present but the remaining body does not parse as JSON. PR Close angular#19958
|
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. |
No description provided.