You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar questions have been asked in the past on Stackoverflow and others, but there is a Proxy that is similar and still doesn't work.
I have seen that it works correctly without other Proxies or Proxies, but with certain Proxies something in the request is missing or corrupted and I have seen that a 400 Bad Request is returned from the server.
We have also confirmed that the problem is not a Proxy.
We have seen successful requests in Python's requests module, etc.
To Reproduce
This only happens with some Proxies, which are difficult to reproduce because they require purchase.
So I can send logs instead.
Is there some fix for this? I am getting the same error and when checking using a TCPdump towards the proxy itself I can see that Axios skips sending the CONNECT request, which of course will make the Proxy send 400 as it expects to receive a CONNECT request before the actual GET request.
Closing due to age and lack of reproduction. A 400 returned through a proxy is almost always the proxy or upstream rejecting the request shape (missing Host header, CONNECT vs absolute-URI form, proxy auth). Compare the on-the-wire request against one made with curl through the same proxy.
If you can still reproduce on a current axios version with a minimal case, please open an issue and tag me.
Activity
Safari77 commentedon Mar 4, 2023
Something in Microsoft Code is doing (squid log):
1677924294.688 103/ 102 127.0.0.1:42116 TCP_DENIED/403 3960 GET - https://api.adoptium.net/v3/info/available_releases 1.1 - HIER_NONE/- text/html "axios/0.21.4"It should do:
CONNECT api.adoptium.net:443 HTTP/1.1and wait for
HTTP/1.1 200 Connection establishedFor more details, see
RFC 7230.Originally specified in
RFC 2817(published on May 2000).paulhybryant commentedon Apr 28, 2023
I am getting this error still
fantik11 commentedon May 15, 2023
Having this error too
binitgutka commentedon May 18, 2023
I am also getting the same error.
Baatezus commentedon Aug 31, 2023
I am also getting the same error.
livingflore commentedon Sep 28, 2023
+1
m4heshd commentedon Feb 19, 2024
Why is this issue being ignored? Wasted about 3 hours of my day. 🫤
[net-util] Fix `BAD_REQUEST` error when proxying API requests
terion-labs commentedon Apr 17, 2024
Getting this on Node environment, while in Bun — proxy works
fix: use node-fetch for data downloads to avoid Axios proxy issues (#…
rriemann commentedon Sep 19, 2024
That's my workaround.
Please fix this soon. It took me quite some time to track down this issue.
oakh1 commentedon Feb 18, 2025
Is there some fix for this? I am getting the same error and when checking using a TCPdump towards the proxy itself I can see that Axios skips sending the CONNECT request, which of course will make the Proxy send 400 as it expects to receive a CONNECT request before the actual GET request.
AdrianoLMRS commentedon Aug 11, 2025
same issue here...
jasonsaayman commentedon Apr 24, 2026
Closing due to age and lack of reproduction. A 400 returned through a proxy is almost always the proxy or upstream rejecting the request shape (missing Host header, CONNECT vs absolute-URI form, proxy auth). Compare the on-the-wire request against one made with curl through the same proxy.
If you can still reproduce on a current axios version with a minimal case, please open an issue and tag me.