Describe the bug
When axios request sets maxRedirects=0 and encounters an unresponsive website, it will not execute further.
To Reproduce
When axios requests to set maxRedirects=0, it encounters an unresponsive website without any printing information. When set to non-zero, error.message is aborted
tcp package

http package


Code snippet
(async () => {
try {
const url = "http://192.168.12.18:10019/"
const response = await axios.get(url, {
maxRedirects: 0,
headers: {"user-agent": "Mozilla/5.0 compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0"},
timeout: 10000
});
console.log(response.data)
} catch (error) {
console.log(error.message)
}
})();
Expected behavior
When set to 0, an exception is thrown normally
Axios Version
1.7.4
Adapter Version
HTTP1.1
Browser
No response
Browser Version
No response
Node.js Version
20.12.0
OS
debian12
Additional Library Versions
Additional context/Screenshots
Describe the bug
When axios request sets maxRedirects=0 and encounters an unresponsive website, it will not execute further.
To Reproduce
When axios requests to set maxRedirects=0, it encounters an unresponsive website without any printing information. When set to non-zero, error.message is aborted
tcp package

http package
Code snippet
Expected behavior
When set to 0, an exception is thrown normally
Axios Version
1.7.4
Adapter Version
HTTP1.1
Browser
No response
Browser Version
No response
Node.js Version
20.12.0
OS
debian12
Additional Library Versions
Additional context/Screenshots