vlki / refresh-fetch

Wrapper around fetch capable of graceful authentication token refreshing.
MIT License
84 stars 12 forks source link

Fix bug when response empty content and no content-type header present #2

Closed cccmien closed 6 years ago

cccmien commented 6 years ago

For instance when doing a DELETE request and the server returns HTTP 204 No Content without content-type header, the code would break when checking the content type for 'json'. This fix checks if content-type header was present or not.

vlki commented 6 years ago

Yeah, you're right. There could even be check for 204 response status code. But your change is a good start. Thanks for contribution!

vlki commented 6 years ago

Released as 0.5.1