Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make FetchRequest not try and parse a 204 response body
It currently checks for the presence of a Content-Type response header and if present assumes that trying to parse the response will succeed. Realtime currently sends a 204 (No Content) with a Content-Type header from the POST rest.ably.io/push/publish endpoint when using HTTP 1.1 (see REA-1924). (This bug hasn't been caught by the tests because I guess most of the time they use HTTP 2 in browsers, and also we don't use FetchRequest in the tests except briefly in those for the modular variant of the library. I’ve created #1772 for improving this situation). The 204 handling approach is copied from that which we already have in XHRRequest. Resolves #1771.
- Loading branch information