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

Resource "/foo/%2F" is translated by HttpClientHelper to "/foo//", which becomes "/foo", a different resource #51

Open
joshgontijo opened this issue Oct 12, 2017 · 0 comments
Assignees

Comments

@joshgontijo
Copy link
Owner

From #125

[WireMock 2.0.6-beta]

HttpClientHelper::prepareRequest takes a perfectly value url http://localhost:8800/api/exchanges/%2F out of a GetRequest and calls URLDecoder::decode on it, producing http://localhost:8800/api/exchanges// and uses it to build a java.net.URI, which it eventually uses to make the HTTP Get call. (line 172, HttpClientHelper.java) This is not the same thing, and the server tends to treat it as http://localhost:8800/api/exchanges/ (one slash) and return the wrong thing.

Why does it url-decode the input url anyway? Or it may be that java.net.URI is doing the wrong thing (I've had a hard time getting that class to behave transparently before). In any event, how can I pass http://localhost:8800/api/exchanges/%2F to the REST service?

(In case you're wondering why this is necessary, the RabbitMQ administration REST service for getting back a list of exchanges for a single vhost takes a URL of the form /exchanges/, but the default vhost on RabbitMQ is named "/" (that is, a single slash) and their documentation thus specifies request for that vhost must use %2F - see the second paragraph of the documentation, here.)

@joshgontijo joshgontijo self-assigned this Apr 24, 2018
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

1 participant