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
{{ message }}
Repository navigation
After upgrade to 1.0 GET request with parameters in the url fail #4999
Not really ... sorry. I can't give you access to our GIT server to make that GIT api call. I am not sure if its a generic thing with any parameters in the url or just this specific set.
Anything I can provide you with as far as debug print outs where I can remove internal data?
No need for git acces, just a 2 files repository on github with a nodejs script that calls an express server that throws the same error. Because the above information doesn't seem enough to find a precise solution.
For illustration ... a curl command that returns with my personal GIT Access token a list of commits when searching the axios repo. As I said its just for illustration. If you want to execute the curl command you need to update the my_token value in the command.
I am also having the same or similar issue, I was just studying and when I installed the new upgraded version my get call was returning a 404 not found status. I'm using node --version v16.17.0. My study code was something like this:
This might be an oversight but in v1 we have been a lot stricter with our URL parsing. The URL is for your URL free of any query params. Thus we have params as part of the config.
If you use a URL like this http://test.example.com?test=1 we will be stripping out the ?. Please use the params to set query params.
Reacted by Vedran Milic, Andreas Brekken, petarpanicVIU, Roman Zhuravlov, Stefan Wagner, Jianqi Pan, casret, Michał Miszczyszyn, bregoNMI, David Beaudway and 7 more
That's ridiculous. I love axios and it's my goto client in node but this breaking change hurts the ergonomics of the library.
Reacted by Vedran Milic, Roman Zhuravlov, Stefan Wagner, gdelory, Michał Miszczyszyn, Marcin Witas, bregoNMI, Nico Labarre, David Beaudway, Thiago Vieira and 11 more
Does this mean that, to send a request to an URL from elsewhere that may contain a query string, I have to detect the question mark, split the URL manually and put the querystring into the params? This probably also means that I should be using URLSearchParams to avoid writing a querystring parser myself, right?
Same here, we're going to refactor but there is no mention of this in the breaking changes
Reacted by Daniel Dugovic, Gouezou Yann-vaï, Arthur Cayet, gdelory, Niklas, redundantautomata, Nico Labarre, David Beaudway, Thiago Vieira , Phil Brown and 2 more
For those wondering, or too lazy to refactor everything, or using Axios to fetch full URLs they don't manage (our use case: we fetch a RSS feed containing links to items and the item URL might contain query params, it's an opaque string for us) I resorted to using this interceptor:
instance.interceptors.request.use((req)=>{consturl=newURL(axios.getUri(req)),// getUri will build the final URI, merging defaultsparams=newURLSearchParams(url.searchParams);url.search='';req.url=url.href;// The URL without query paramsreq.params=params;// The merged query params from defaults + requestreturnreq;});
In my context, I'm paying the extra CPU cycles for the useless interceptor. I'm hoping for Axios to reintroduce previous behavior
Reacted by Michał Miszczyszyn, Asif Adnan and Sebastian Campos
Thanks, @ddolcimascolo. Is the order of the params deterministic? I'm using axios for an API that signs the search params and appends that as the last search param:
GET /some-api/secret?f1=a&f2=b&f3=c&signature=<sig>
Where <sig> is determined by signing GET/some-api/secret?f1=a&f2=b&f3=c
Thanks, @ddolcimascolo. Is the order of the params deterministic? I'm using axios for an API that signs the search params and appends that as the last search param:
GET /some-api/secret?f1=a&f2=b&f3=c&signature=<sig>
Where <sig> is determined by signing GET/some-api/secret?f1=a&f2=b&f3=c
No probs but credit goes to @DigitalBrainJS. Sorry for all the problems this caused. Please can anyone interested watch our releases as we need many more testers on pre-releases, I can only do so much.
Reacted by Dmitriy Mozgovoy, jweingarten, Thiago Vieira , Evan Hurd, redundantautomata, William Yardley, stefan-sabau, Ross Topol, erik-itland and Samuel A. Lamb
Activity
arthurfiorette commentedon Oct 5, 2022
Weird...
Can you provide a reproducible repository so it can be tested out more quickly?
jweingarten commentedon Oct 5, 2022
Not really ... sorry. I can't give you access to our GIT server to make that GIT api call. I am not sure if its a generic thing with any parameters in the url or just this specific set.
Anything I can provide you with as far as debug print outs where I can remove internal data?
arthurfiorette commentedon Oct 5, 2022
No need for git acces, just a 2 files repository on github with a nodejs script that calls an express server that throws the same error. Because the above information doesn't seem enough to find a precise solution.
jweingarten commentedon Oct 5, 2022
How about this?
Curl command for illustration only
For illustration ... a curl command that returns with my personal GIT Access token a list of commits when searching the axios repo. As I said its just for illustration. If you want to execute the curl command you need to update the
my_tokenvalue in the command.Request:
Response looks normal as I get a list of commits.
Axios v1.0.0-alpha.1
Steps/Run
my_tokenwith your GIT Access token in above code and save.Response looks normal as I get an array of commits back.
Axios v1.0.0
Steps/Run
Response
jweingarten commentedon Oct 5, 2022
Forgot to mention ... I am testing with
node --version v14.18.2ScriptCamilo commentedon Oct 5, 2022
I am also having the same or similar issue, I was just studying and when I installed the new upgraded version my get call was returning a 404 not found status. I'm using
node --version v16.17.0. My study code was something like this:It works fine on the
"axios": "^0.27.2"jasonsaayman commentedon Oct 5, 2022
This might be an oversight but in v1 we have been a lot stricter with our
URLparsing. The URL is for your URL free of any query params. Thus we haveparamsas part of the config.If you use a URL like this
http://test.example.com?test=1we will be stripping out the?. Please use the params to set query params.evanhurd commentedon Oct 5, 2022
That's ridiculous. I love axios and it's my goto client in node but this breaking change hurts the ergonomics of the library.
janitza-mage commentedon Oct 5, 2022
I have the same problem as the original poster.
Does this mean that, to send a request to an URL from elsewhere that may contain a query string, I have to detect the question mark, split the URL manually and put the querystring into the params? This probably also means that I should be using URLSearchParams to avoid writing a querystring parser myself, right?
ddolcimascolo commentedon Oct 5, 2022
Same here, we're going to refactor but there is no mention of this in the breaking changes
ddolcimascolo commentedon Oct 5, 2022
Fun fact,
axios.getUristill work... This honestly look like ther's something weird.Can we get a word from Axios maintainers ?
ddolcimascolo commentedon Oct 5, 2022
For those wondering, or too lazy to refactor everything, or using Axios to fetch full URLs they don't manage (our use case: we fetch a RSS feed containing links to items and the item URL might contain query params, it's an opaque string for us) I resorted to using this interceptor:
In my context, I'm paying the extra CPU cycles for the useless interceptor. I'm hoping for Axios to reintroduce previous behavior
abrkn commentedon Oct 5, 2022
Thanks, @ddolcimascolo. Is the order of the params deterministic? I'm using axios for an API that signs the search params and appends that as the last search param:
GET /some-api/secret?f1=a&f2=b&f3=c&signature=<sig>Where
<sig>is determined by signingGET/some-api/secret?f1=a&f2=b&f3=cabrkn commentedon Oct 5, 2022
This is a very unfortunate breaking change which I hope the maintainers will reconsider.
ddolcimascolo commentedon Oct 5, 2022
I'd say yes
16 remaining items
Fixed query params composing; (#5018)
jasonsaayman commentedon Oct 5, 2022
Fixed with #5018
jasonsaayman commentedon Oct 5, 2022
Sorry about that, something that I should have picked up, I will try to be a bit more strict on changes which are to largely incompatible.
ddolcimascolo commentedon Oct 5, 2022
Thx for fixing @jasonsaayman 👍
jasonsaayman commentedon Oct 5, 2022
No probs but credit goes to @DigitalBrainJS. Sorry for all the problems this caused. Please can anyone interested watch our releases as we need many more testers on pre-releases, I can only do so much.
ci: Workaround for axios@1
gdelory commentedon Oct 6, 2022
Any idea on the date of the next release? Just to know if we rollback to 0.x or wait for the new release :)
jasonsaayman commentedon Oct 6, 2022
Releaseing now
philBrown commentedon Oct 6, 2022
@jasonsaayman Why was the fix shipped in a minor release and not a patch? I would have expected v1.0.1
Won't this remain broken for anyone using approximate equivalent version?
abrkn commentedon Oct 7, 2022
Thanks for fixing this issue so quickly, @jasonsaayman!
janitza-mage commentedon Oct 7, 2022
Can confirm that it works for me. That was fast! Thanks a lot.
jasonsaayman commentedon Oct 7, 2022
Im bumping as minor cause its not the only change
philBrown commentedon Oct 7, 2022
@jasonsaayman could you please roll out a v1.0.1 patch release with the URL query param fix then?
That or pull v1.0.0 entirely. As mentioned already, anyone using ~1.0.0 won't get the fix
mgiraldo commentedon Mar 29, 2023
had this same issue. reverting to
0.27.2fixed it.this is how a working call looks for me (v0.27.2):
this is what a broken call looks for me (v1.3.4) with no code changes, just upgrading the package:
rangelanino commentedon Mar 30, 2023
Same issue. Though I think its partly because our app uses WebPack and not Rollup.