ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

Using .retry with callback when status is 200 will not be processed #1629

Open hofmannnn opened 3 years ago

hofmannnn commented 3 years ago

When trying to retry with a callback when getting 200 and return true in the callback function - the request will get stuck and will not return a valid response, only if we set a timeout we will finally get an error but the request will not be processed.

you may ask why would one want to retry a request when he got 200, the reason is that an API returns 200, and in the body return an inner status that unfortunately is not reflected in the normal HTTP statues.