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

cannot request paths containing escaped slash, i.e. '/api/exchanges/%2f/amq.direct' #34

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

Comments

@joshgontijo
Copy link
Owner

From #160

Trying to access the RabbitMO management API, I figured out, that it is impossible to send a request to an URL containing an escaped slash '/', i.e. '/api/exchanges/%2f/amq.direct'
That's mainly because the java URI(scheme,...,...) constructor would do a toString() first qouting/escaping all parameters and than parse the resulting string; during the toString() however the path is quoted/encoded, so a a string like '%2f' is written out as '%252f'.
And specifying the path as '/api///whatever' is not a solution either, as the '/' is valid path character, and does not get escaped.

One might surely argue, that this is Java URI problem, however it prevents unirest-java to be used with URIs containing an escaped '/'.


Inside com.mashape.unirest.http.HttpClientHelper method prepareRequest, the URL is split up into an URI where the path is url-decoded. This url-decoding seems not correct.
For me it creates
http://host/v1/guid//test/tree
from
http://host/v1/guid/%2Ftest/tree
which then leads to a 404 on the server.


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