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

clout incorrectly excludes ',' from allowed path characters #23

Closed
tcrayford opened this issue Jan 26, 2015 · 3 comments
Closed

clout incorrectly excludes ',' from allowed path characters #23

tcrayford opened this issue Jan 26, 2015 · 3 comments

Comments

@tcrayford
Copy link

It looks like https://github.com/weavejester/clout/blob/master/src/clout/core.clj#L91 incorrectly excludes , from the characters it's willing to match in a path, given the characters allowed in a path (see http://stackoverflow.com/questions/4669692/valid-characters-for-directory-part-of-a-url-for-short-links/4669755#4669755 for one listing of such).

@weavejester
Copy link
Owner

A Clout parameter isn't the same thing as a path segment, so the default regular expression for a parameter isn't necessarily going to match up to a definition of a path segment.

@tcrayford
Copy link
Author

@weavejester : so I guess the suggested workaround here is to supply custom regexes for matching path segments that don't match up with the default path segments?

(btw this had customers hitting 404s on my app today - I was escaping parameters with ring.util.codec/url-encode and then generating urls that were invalid)

@weavejester
Copy link
Owner

A workaround implies that this is a bug, rather than an incorrect assumption. If you want a parameter to exactly match the definition of a path segment, then yes, you'll need to supply your own regular expression.

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

2 participants