rest-cljer
rest-cljer copied to clipboard
Issue with matching encoded paths
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.
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.