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

Path is not matched if path param contains slash #343

Closed
kliakos opened this issue Aug 31, 2015 · 2 comments
Closed

Path is not matched if path param contains slash #343

kliakos opened this issue Aug 31, 2015 · 2 comments

Comments

@kliakos
Copy link
Contributor

kliakos commented Aug 31, 2015

Take the following example:

        Spark.get("/orders/:order_id", (request, response) -> {
            return request.params("order_id");
        });

The path /orders/ABC1 is matched, the path /orders/ABC%2F1 not. Major problem. Wildcard parameters instead work fine though.

@perwendel
Copy link
Owner

@kliakos
It seems like Jetty allows encoded slashes. However Apache does not by default and other web server might not (https://stackoverflow.com/questions/3235219/urlencoded-forward-slash-is-breaking-url). I'm not sure what is best practice. May I ask why your URL contains slashes?

@kliakos
Copy link
Contributor Author

kliakos commented Sep 3, 2015

Hm, I wasn't aware this is a general issue with web servers. But nginx which I use has no problem.

Regarding why I need them, I actually have a REST api with order ids that contain forward slashes.

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

No branches or pull requests

3 participants