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 Cleaning Causes Re-Direct #142

Closed
tomwilkie opened this issue Jan 11, 2016 · 1 comment
Closed

Path Cleaning Causes Re-Direct #142

tomwilkie opened this issue Jan 11, 2016 · 1 comment

Comments

@tomwilkie
Copy link

We have an app that needs to accept arbitrary URL-encoded variables in its path; we ran in the the usual go-bug (golang/go#10887) of encoded slashes not being handled correctly, and wrote a custom URLMatcher to deal with this. All was good.

It turns out that if our variable containing a url encoded slash starts with a slash, we hit the cleanPath code path as go decodes the %2F to a slash, the cleanPath dedupes // to a single slash and gorilla does a redirect.

This may be a dupe of #94, but I'm inclined to say its more serious as I don't seem to be able to override this with my own URLMatcher, which is kinda the whole reason we use gorilla in the first place.

Any thoughts on how to deal with this?

@tomwilkie tomwilkie changed the title /foo/%2Fbar gets redirects to /foo/bar /foo/%2Fbar gets redirected to /foo/bar Jan 11, 2016
@elithrar elithrar added the bug label Jan 16, 2016
@elithrar elithrar changed the title /foo/%2Fbar gets redirected to /foo/bar Path Cleaning Causes Re-Direct Jan 16, 2016
@elithrar
Copy link
Contributor

See #154

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

2 participants