rest-cljer icon indicating copy to clipboard operation
rest-cljer copied to clipboard

Issue with matching encoded paths

Open mt3593 opened this issue 7 years ago • 1 comments

So this fails:

(rest-driven
    [{:method :GET
      :url "/path/with%2Finpath/ok"}
     {:status 200}]
  (http/get "http://localhost:8081/path/with%2Finpath/ok"))

but this passes:

(rest-driven
    [{:method :GET
      :url "/path/with/inpath/ok"}
     {:status 200}]
  (http/get "http://localhost:8081/path/with%2Finpath/ok"))

Not invested anymore time into this yet, but my feeling is this is probably in the root java library rather than here.

mt3593 avatar Sep 13 '17 09:09 mt3593

The offending line:

https://github.com/rest-driver/rest-driver/blob/d7af96801f152af3d7bb0abf534481914bf98e0d/rest-client-driver/src/main/java/com/github/restdriver/clientdriver/HttpRealRequest.java#L50

getPathInfo is decoded according to the servlet specification, and it's this string that is ultimately compared to the expected URL.

I realise there would be information lost here, but if you really need this fixed then the best course of action may be for us to decode the :url value in rest-cljer before passing it to rest-driver.

joelittlejohn avatar Mar 10 '18 22:03 joelittlejohn