got: Request hangs up with GOT v11
Describe the bug
- Node.js version: 12.16.3
- OS & version: Debian Buster
Actual behavior
Request gets stuck while downloading. …
Expected behavior
Request should either timeout or give correct response …
Code to reproduce
const agent = {
http: new http.Agent({ keepAlive: true }),
https: new https.Agent({ keepAlive: true })
};
var requestOptions = {
timeout: 45000, // milliseconds
responseType: 'buffer',
retry: 0,
maxRedirects: 5,
dnsCache: false,
headers: {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5'
},
shared: false,
agent,
cache: cacheStore
};
got.get("https://www.empiresuppliesonline.co.uk/ekmps/shops/empiresupplies/images/Waring-X-Prep-Kitchen-Blender-2523-p.jpg", requestOptions);
I am using https://www.npmjs.com/package/improved-cacheable-request as cache store.
Please note I download around 500 such URLs per minute but the issue majorly happens with this given domain name.
Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19
I think this might the issue we’re currently having in our project.
Minimal repo (Node v12.18.0) (edit: added
ETag
-Header on 304 response):got@10.7.0
seems to work fine:got@11.0.3
returns an empty response on the second request:got@11.1.4
andgot@11.2.0
hangs forever:Any idea of what’s wrong here or should I open a new issue?
With some “High quality debugging” (
console.log
) I can say that_onResponse
is not called the second time.I’m going to look into why that doesn’t happen.