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

Option to use url encoded parameters in capture route patterns #185

Closed
mihaigiurgeanu opened this issue Dec 5, 2015 · 1 comment
Closed

Comments

@mihaigiurgeanu
Copy link

It would be nice to have the option to use path encoded parameters in capture route patterns. This is useful to me because I am developing a REST api, and my resources are full path names to files, so they contain slashes. I use urlEncode to encode the slashes, but they are decoded before parsing the RouteParam.

In other words, I need to process the following request:

POST /files/program%2Ffolder%2Fprogram.exe

and I'd like, when using capture route pattern like this:

post "/files/:filename" $ do
  filename <- param "filename"
  ...

the filename to have the value program/Folder/program.exe

For now, I am using regex route pattern to obtain the same effect.

post (regex "/files/(.*)") $ do
  filename <- param "1"
  ...
@ocramz ocramz changed the title Option to use url encoded parameters in capture route patterns (disable path traversal protection) Option to use url encoded parameters in capture route patterns Dec 17, 2023
@ocramz
Copy link
Collaborator

ocramz commented Dec 17, 2023

This was fixed by #302 thanks to @jfraudeau !

@ocramz ocramz closed this as completed Dec 17, 2023
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