GEDYSIntraWare / cordova-plugin-webview-proxy

Plugin to proxy requests through the webview
https://www.npmjs.com/package/cordova-plugin-webview-proxy
MIT License
21 stars 13 forks source link

Plus sign "+" is not handled properly when passed in the URLs in iOS #31

Open ghevge opened 2 months ago

ghevge commented 2 months ago

Describe the bug Plus sign "+" is not handled properly when passed in the URLs. I noticed that when I pass the plus sign in a URL, if it is not escaped, if it is escaped a single time or if it is escaped twice, the plugin is passing it to the upstream as unescaped: "+"

This is causing problem on upstream, where it is processed as an empty space.

If I escape the plus sign 3 times, the plugin will pass it over as double escaped: "%252B" which again is not OK as I will read "%2B" on my server side.

Any idea what is going on here?

Thanks

To Reproduce Pass "%2B", "%252B" and "%25252B" as params in a URL through cordova-plugin-webview-proxy in iOS.

Expected behavior the proxy should allow passing the "%2B" as a parameter to upstream servers.

Logs not available

ghevge commented 2 months ago

If i remove the following 2 lines from the ios code, and pass in an escaped url, everything works ok

startPath = [startPath stringByRemovingPercentEncoding];
startPath = [startPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

Something is getting messed up during re-encoding