tailrecursion / ring-proxy

HTTP proxy ring middleware for Clojure web applications.
47 stars 14 forks source link

Patch for double URL encoding bug #1

Closed arrdem closed 11 years ago

arrdem commented 11 years ago

Using this library I encountered an issue where the proxy forwarded requests were generating errors on the recieving server due it seemed to malformed url parameters. Upon inspection I realized that (:query-string) is still url-encoded, so if it is passed directly to (URI.) which is then stringified the parameters part will be urlencoded twice. Due to the URLencode of "%20" being "%2520", this is a clear source of proxy'd request failures.

One possible fix, and the one I have live and propose here is to just concatenate the already URL-encoded parameters and the parameter prefix "?" to the end of the computed new URI.

alandipert commented 11 years ago

Thanks! I merged and pushed another snapshot.