Open superhawk610 opened 2 years ago
cc @wongstein
This bug seems very easy to verify.
A '+' in the query string must not be encoded, it is already an encoded space.
Go to any browser and try for example https://www.google.com/search?q=hello+world - and it will search for "hello world". Use the same URL in Insomnia, and it will search for "Hello+world". This is a bug, it should search for "hello world".
You can also just go to Google and search for "hello world", and notice that the url contains "q=hello+world".
Expected Behavior
Sending a GET request to
http://localhost:3000/some/path?foo=bar+baz
should send the following HTTP request to the server running at port3000
:Specifically, the query string
?foo=bar+baz
should be passed through unchanged, as+
belongs to the set of URI reserved characters as defined in RFC 3986, Section 2.2 (emphasis mine):Here's the relevant portion:
Actual Behavior
This request is sent to the server running on port
3000
:%2B
is the correct percent-encoded equivalent to the literal plus sign+
, but the plus sign is a reserved character used to indicate whitespace in URIs and thus should not be percent-encoded. Here are examples from a few popular languages' URI parsing libraries (Elixir, Node, Python) to illustrate why this is problematic:Reproduction Steps
No response
Is there an existing issue for this?
Additional Information
I'm opening a new issue to follow up on #1712. That issue referenced a specific URL that showed why this percent encoding was problematic, where the user expected 1 or more search results but got 0 because whitespaces in the query were replaced with
+
.Insomnia Version
2022.5.1
What operating system are you using?
macOS
Operating System Version
macOS Monterey 12.3.1
Installation method
download from insomnia.rest
Last Known Working Insomnia version
n/a