Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with matching encoded paths #41

Open
mt3593 opened this issue Sep 13, 2017 · 1 comment
Open

Issue with matching encoded paths #41

mt3593 opened this issue Sep 13, 2017 · 1 comment

Comments

@mt3593
Copy link
Contributor

mt3593 commented Sep 13, 2017

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.

@joelittlejohn
Copy link
Collaborator

joelittlejohn commented Mar 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants