cljs-http icon indicating copy to clipboard operation
cljs-http copied to clipboard

Encoded URI path gets decoded

Open Quantisan opened this issue 11 years ago • 3 comments

I'm trying to send a GET request something like http://example.com/articleUrl/http%3A%2F%2Fwww.wiscnews.com%2Fsports%2Farticle_c8b5102a-c30a-5906-86a1-2ffef91f858f.html/ but the actual request sent keeps getting decoded somehow. Any pointer as to where to unit test this in cljs-http please?

Quantisan avatar Jul 16 '14 15:07 Quantisan

Not sure, but maybe this one? https://github.com/r0man/cljs-http/blob/master/src/cljs_http/util.cljs#L18

r0man avatar Jul 16 '14 16:07 r0man

The issue seem to be that the URL is parsed, then rebuilt, and on rebuild step, goog.Uri can't encode the path (there's only decode option). Any particular reason why the url is parsed in wrap-url and then re-built later with build-url inside core/request instead of just parsing it once in core/request?

Quantisan avatar Jul 24 '14 02:07 Quantisan

Hi Quantisan,

the wrap-url middleware parses the URL into a Clojure map that is compatible with the Ring SPEC. If possible I would like to keep it that way and produce requests maps that are the same or similar to clj-http.

Roman

r0man avatar Jul 27 '14 09:07 r0man