The fetch implementation in Bun does not fully handle 302 and 308 status codes correctly.
When we runs a script that more then 256 redirect rquests, which the default value of BUN_CONFIG_MAX_HTTP_REQUESTS, the script will hung up. It looks like ran out of MAX HTTP REQUESTS.
Here is the snapshot of reproduce scripts & output:
What version of Bun is running?
Hint: the issue occurs after 1.1.24.
What platform is your computer?
No response
What steps can reproduce the bug?
The fetch implementation in Bun does not fully handle 302 and 308 status codes correctly.
When we runs a script that more then 256 redirect rquests, which the default value of
BUN_CONFIG_MAX_HTTP_REQUESTS
, the script will hung up. It looks like ran out of MAX HTTP REQUESTS.Here is the snapshot of reproduce scripts & output:
What is the expected behavior?
To avoid this error, use
fetch(url, { redirect: "manual" })
. The default behavior isredirect: follow
, which can lead to unexpected issues widely.What do you see instead?
No response
Additional information
No response