Closed
Description
Describe the issue
When calling axios.get() in an async function, passing in username and password authentication, intermittently the request will hang and never resolve.
Using the axios-debug-log package, I can see that Axios places the get request correctly, however, no response is ever returned. Nor is an error thrown.
This issue had also been found when using axios.get() to return an array buffer, however, I used a write stream as a temporary workaround for that case scenario.
Example Code
try {
const { data } = await axios.get(`URL`, { auth: { username: username, password: password }});
const images = _.filter(data.colorized, (image) => image["@primaryColorOptionCode"] == colorCode && image["@backgroundDescription"] == "Transparent" && image["@width"] == "2100");
return images;
} catch(err) {
this.logger.error(err.message);
return [];
}
Expected behavior, if applicable
axios.get() to resolve its request, and return the response to the data constant.
I have tried both in Postman [9.17.1], Chrome [100.0.4896.127], and the vanilla Node.js HTTP package and was able to consistently make these GET requests. The problem only arises when utilizing Axios.
Environment
- Axios Version [0.27.2]
- Adapter [HTTP]
- Browser [Chrome]
- Browser Version [100.0.4896.127]
- Node.js Version [17.8.0]
- OS: Manjaro [21.2.6] and Ubuntu [lts-buster-slim]
- Additional Library Versions Nest.js [8.0.0] axios-debug-log [0.8.4] lodash [4.17.21]
Additional context/Screenshots
Metadata
Metadata
Assignees
Labels
No labels