insomnia
insomnia copied to clipboard
Proxy Authentication with support for special characters in password
Describe the bug Proxy password can contain special characters such as @,# so on. Current proxy with authentication setting in Insomnia doesn't support special characters.
To Reproduce Steps to reproduce the behavior:
- Go to 'preference -> http network proxy '
- Put on url as 'http://user:p@ss#@proxyurlhost:port
- Do a normal API request
- See error 'couldn't resolve proxy name'
Expected behavior Proxy with authentication should work with any password.
**Desktop **
- OS: [macOS 10.14.6]
- App Version [2020.3.3]
After some digging, I think I found the root cause of the issue.
Currently, we give the proxy URL directly in a Curl option: see here) It seems that Curl does not parse the URL to extract the user:password. That's why in the timeline, we can see
Could not resolve proxy: ss
Curl thinks the stuff after the first @ is the proxy URL...
It seems that we can provide proxy credentials in another option CURLOPT_PROXYAUTH I will implement that, but before, I need to find a way to test it, like creating a simple proxy server.
I've tried something in the Console:
> new URL('http://user:p@ss#@proxyurlhost:port')
<- URL {origin: "http://ss", protocol: "http:", username: "user", password: "p", host: "ss", …}
As you can see, the URL is not parsed correctly. This should be the original cause. 🤔 If found this that explains the differences between specs related to URL.
@develohpanda @nijikokun What do you think about adding in the settings 2 attributes to fill the proxy user and the proxy password?
Another possibility would be to extract the user/password from the URL? We would need to do it manually because "automatic" parsing using new URL() won't work even if we encode the string before:
new URL('http://user:p%40ss%23@proxyurlhost:port')
Uncaught TypeError: Failed to construct 'URL': Invalid URL
at <anonymous>:1:1
@jgiovaresco 👍 for different input for user/pwd. This will also ensure password is a secure input and not in cleartext in URL.
What do you think about adding in the settings 2 attributes to fill the proxy user and the proxy password?
@jgiovaresco seems reasonable! 👍
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi. Can you help me use those two fields? I cannot log in cause of special characters Thanks