You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
...
The text was updated successfully, but these errors were encountered:
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
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:
and I'd like, when using capture route pattern like this:
the filename to have the value
program/Folder/program.exe
For now, I am using regex route pattern to obtain the same effect.
The text was updated successfully, but these errors were encountered: