New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: query parameters are escaped implicitly #2829
Comments
If I send the request with the following parameters.
Then the request is ok. It seems the space in url query string can be So maybe the request works in postman is because it checks whether some spaces are in the parameters or not, A config setting toggles the |
https://www.fullhost.com/blog/what-does-20-mean-in-a-web-address/ url1=new URL('http://localhost/?token=token_part1+token_part2&attrs=password%253abc')
url2=new URL('http://localhost/?token=token_part1%20token_part2&attrs=password%253abc')
console.info(url1.searchParams.get('token')) // token_part1 token_part2
console.info(url2.searchParams.get('token')) // token_part1 token_part2
console.info(url1.searchParams.get('token') === url2.searchParams.get('token')) // true |
Since the current implementation is correct according to the spec, we are prioritizing this as a low priority issue. PR contributions for implementing the toggle for considering both ways are welcome in the meantime :) |
Just getting started on contributions @AndrewBastin I can work on implementing the toggle. |
Cool @Rathan-Naik, please do let me know if you need any help/guidance. Assigning the task to you. |
Hello @AndrewBastin, |
hey @AndrewBastin i would like to contribute to this issue. Please let me do it. |
@JManan sure. |
hey @AndrewBastin I would like to contribute to this issue.give me a chance |
Hey @tejakummarikuntla I would like to work on this, can you please assign this to me !! |
Sorry @VinayakSingh2001 , I don't think I can help you here. Did you mean to tag @AndrewBastin ? |
Hey @tejakummarikuntla is the issue still open? |
No PR currently? I suggest to add a configuration named Encode(Encode the query params, three options provided, enable means always encode the params, disable means do not encode the params and auto means encode the params which contain some common special characters need to encode). And only two group of settings available now, one for |
it is need to add a toggle like space as %20 or + or i change to direct convert space as %20? |
@tejakummarikuntla If this issue is still open and no PR raised yet, i would like to give a try. |
Assigning to @maneeshms. |
Hey @liyasthomas it's been a while since there has been some activity on this thread. If you've still not received any PR's for this, maybe I can take a look with some assistance from you? |
Is there an existing issue for this?
Current behavior
When I send a
Get
request with the following parameters(in bulk edit).The actual request sent is
url?token=token_part1+token_part2&attrs=password%253Dabc
which is wrong for my server.If I send the same
Get
request using postman, the actual request sent isurl?token=token_part1%20token_part2&attrs=password%3Dabc
which is correct for my server.I found the problem code is around the following code.
hoppscotch/packages/hoppscotch-app/src/helpers/strategies/ExtensionStrategy.ts
Lines 64 to 70 in dc80cc8
See also https://developer.mozilla.org/en-US/docs/Web/API/URL/toString, https://javascript.info/url, https://url.spec.whatwg.org/#URL-stringification-behavior.
Steps to reproduce
Parameters
tab, clickBulk edit
.Send
button to make the request.Environment
Release
Version
Cloud
The text was updated successfully, but these errors were encountered: