-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
"unexpected end of file" with gzipped 304 HTTP response #3055
Copy link
Copy link
Closed
Description
Describe the bug
When request has Content-Encoding: gzip|deflate|compress header and response has 304 Not Modified status code the following error is thrown: unexpected end of file.
To Reproduce
axios({
url: 'https://upload.wikimedia.org/wikipedia/commons/4/47/Sound-icon.svg',
headers: {
'accept-encoding': 'gzip, deflate',
'If-None-Match': 'c523b36f867debdf152790574ec4989b'
},
validateStatus(status) { return (status >= 200 && status < 300) || status === 304 }
})
.then(function (response) { console.log('OK') })
.catch(function (error) { console.error(`NOK: ${error}`) });
I get:
NOK: Error: unexpected end of file
Expected behavior
OK
Environment
- Axios: 0.19.2
- Node.js: v12.18.1
Additional context/Screenshots
Basically the same like #1658 but with HTTP 304 Not Modified
Pretty similar to #3036 as well
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels