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

An encoded slash in a path parameter is treated as a path separator #54

Open
kevinstembridge opened this issue Nov 1, 2017 · 2 comments

Comments

@kevinstembridge
Copy link

kevinstembridge commented Nov 1, 2017

The UriTemplate.extract method decodes the URI before splitting it into path parameters.

public PathParameters extract(String uri) {
    List<String> values = groupValues(templateRegex.findMatches(UrlEncodedMessage.decode(trimSlashes(uri))).head());
    return pathParameters(names.zip(values));
}

This causes any encoded slashes to be converted to slashes and treated as a path separator. I'm pretty sure it would be safe to split first and then decode each parameter individually. I cloned and tried to give it a go but repo.bodar.com:80 is blocked by the company firewall.

@kevinstembridge
Copy link
Author

Hi Dan,
Any thoughts on this issue?

kevinstembridge pushed a commit to kevinstembridge/utterlyidle that referenced this issue Dec 13, 2017
@kevinstembridge
Copy link
Author

I've created a pull request for this issue. Could you take a look?

danielbodart added a commit that referenced this issue Dec 18, 2017
Issue #54: An encoded slash in a path parameter is treated as a path …
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