axios: Getting 400 Bad Request in v1.2.0 with same code that returned 200 with v0.27.2
Describe the bug
We are making a get request to an endpoint that works great, returning 200 OK with v0.27.2 of axios, but when we upgrade to 1.0.0 or to the latest 1.2.0, we get 400 Bad requests.
To Reproduce
// run with node index.js
(async () => {
const instance = axios.create({
baseURL: 'https://DOMAIN_SANITIZED/api/internal/v1',
timeout: 1000,
headers: { 'Authorization': 'Bearer SANITIZED' }
});
const response = await instance.get('/request/path/sanitized?q={"merchantId":"SANITIZED 32 CHAR GUID","scheduleType":"CLASS","isDeleted":false}');
console.log(response.data);
console.log(response.status);
//console.log(response.statusText);
//console.log(response.headers);
//console.log(response.config);
})();
Code snippet
No response
Expected behavior
We expect the latest version to work the same as 0.27.2.
Axios Version
1.2.0
Adapter Version
UNKNOWN
Browser
N/A
Browser Version
N/A
Node.js Version
16.17.0
OS
macOS 13.0.1 M1
Additional Library Versions
No additional libs. The code snippet included is a minimal reproduceable example, which has been sanitized.
Additional context/Screenshots
We are unable to include the exact payload that caused the problem since it requires authentication. We suspect/guess that maybe it is some kind of URL encoding issue that may have been introduced in v1.0.0.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 4
- Comments: 16 (10 by maintainers)
Commits related to this issue
- Downgrade Axios because 1.2.1 is still broken Ref: https://github.com/axios/axios/issues/5311#issuecomment-1344332079 — committed to upleveled/notion-backup by karlhorky 2 years ago
- Downgrade Axios because 1.2.1 is still broken Ref: https://github.com/axios/axios/issues/5311#issuecomment-1344332079 — committed to upleveled/notion-backup by karlhorky 2 years ago
I just updated to 1.2.1 from 1.1.3 and am getting the same end of file error:
Both myself and my users have been reporting Axios errors on 1.2.1. I’ll dig up some more detail shortly. Regards Jochen
Seems like these
AxiosError: unexpected end of file
problems are fixed inaxios@1.2.2
@jamesmortensen can you check, and if confirmed, close the issue?