cljs-http
cljs-http copied to clipboard
Encoded URI path gets decoded
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?
Not sure, but maybe this one? https://github.com/r0man/cljs-http/blob/master/src/cljs_http/util.cljs#L18
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?
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