Closed PaulRivier closed 8 months ago
Can you post your code?
On Sun, May 3, 2020, 6:01 AM PaulRivier notifications@github.com wrote:
Hi there,
I can not find a way to match an URL encoded path such as /page/P%C3%A2tes It seems to fail with both capture pattern, placeholders and regex.
Is this a bug ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scotty-web/scotty/issues/262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOIX25U6EJDA5SMNMRVFPTRPVTLJANCNFSM4MYDXQWA .
Hello, thank you for your quick reply.
I messed my test cases before posting my original message, sorry about that. This is a more proper report, thank you for caring.
This works and matches /page/Pâtes
get "/page/:page" $ do
p <- param "page"
servePage p
But I need to match the rest of the url after page, not only first segment, so /page/recette/Pâtes would match with path=recette/Pâtes. I could not find a clean way to get this behaviour, so I used the regex feature.
My regex is something like :
get (regex "^/page/(.+)")
p <- param "1"
servePage p
It does match correctly /page/Hello, but it is buggy on /page/Pâtes. Basically, it will only match "P".
Interestingly, if regexp ends with "$" (like "^/page/(.+)$"), it does not match at all accentuated words.
Maybe the regex feature has some issues with multibytes chars.
I would appreciate a lot to have a pattern to match the remaining of the path, like "/page/:~page" or so.
Thank you.
@PaulRivier url-decoding parameters looks buggy indeed
As pointed out by @jfraudeau this is indeed fixed by #302
Thank you guys.
On Sun, Dec 17, 2023 at 5:19 PM Marco Z @.***> wrote:
Closed #262 https://github.com/scotty-web/scotty/issues/262 as completed.
— Reply to this email directly, view it on GitHub https://github.com/scotty-web/scotty/issues/262#event-11268857389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIT5BNOHCP3YDVI3CBWTAYLYJ4LR5AVCNFSM4MYDXQWKU5DIOJSWCZC7NNSXTWQAEJEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW4OZRGEZDMOBYGU3TGOBZ . You are receiving this because you were mentioned.Message ID: @.***>
Hi there,
I can not find a way to match an URL encoded path such as
/page/P%C3%A2tes
It seems to fail with both capture pattern, placeholders and regex.Is this a bug ?