mmattozzi / cocoa-rest-client

A free, native Apple macOS app for testing HTTP/REST endpoints
http://mmattozzi.github.io/cocoa-rest-client/
Other
2.36k stars 206 forks source link

Double Encoding of Query Parameters #152

Closed pkgulati closed 3 years ago

pkgulati commented 5 years ago

When a space character is used in query parameter value, and query is saved and executed later, it is sending %2520. Actually it is encoding two times, first to %20, and then later storing it is %20, and then doing second encoding to %2520.

mmattozzi commented 5 years ago

Good catch! In fact this is happening even without saving...

mmattozzi commented 5 years ago

Hello. Sorry it took me so long to get back to this, hopefully you're game to discuss it a bit more. I checked in an update that basically removes the double percent encoding. However, this creates what also might be an interesting experience in that if you truly want spaces in your parameters, you'll never see the %20 encoding at all. I've attached what this looks like:

screen shot 2019-02-16 at 10 11 09 am

As you can see, in the parameters table and the URL box itself, a space is just a space (not percent encoded when displayed to the user). However, the target server gets sent a %20 as one would expect. I think this is probably the only sane way to manage this scenario, otherwise it's not really possible to tell the difference between an intended %20 (as unlikely as it is) and when the user was just trying to account for URL encoding on their own.

mmattozzi commented 3 years ago

Fixed in Release 1.4.6