You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed that got returned the wrong response for every second request, when making requests with enabled caching.
Actual behavior
Apparently, when making requests with the cache option, got does not decode the cached response properly (based on the Content-Encoding header of the cached response), but instead uses the Content-Encoding-header of the 304 Not Modified response.
Expected behavior
got should be able to cache and re-use cached response, even if the 304 response is sent with a different Content-Encoding header.
I have tried my code with the latest version of Node.js and Got.
The text was updated successfully, but these errors were encountered:
szmarczak
changed the title
got with caching enabled does not decode compressed cached responses properly
Cache does not decode compressed responses properly
Aug 10, 2022
Describe the bug
We noticed that
got
returned the wrong response for every second request, when making requests with enabled caching.Actual behavior
Apparently, when making requests with the
cache
option,got
does not decode the cached response properly (based on theContent-Encoding
header of the cached response), but instead uses theContent-Encoding
-header of the 304 Not Modified response.Expected behavior
got
should be able to cache and re-use cached response, even if the 304 response is sent with a differentContent-Encoding
header.Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: