com-lihaoyi / cask

Cask: a Scala HTTP micro-framework. Cask makes it easy to set up a website, backend server, or REST API using Scala
https://com-lihaoyi.github.io/cask/
Other
525 stars 55 forks source link

Properly decode URL parameters when passed as path segments or query params #114

Closed lihaoyi closed 8 months ago

lihaoyi commented 8 months ago

Fixes https://github.com/com-lihaoyi/cask/issues/105

getRequestPath seems to parse things wrongly with 1+%2B+1+%3D+2 becoming 1+++1+=+2, losing the distinction between spaces ` and plus+. Swapped ingetRequestURI` which gives us the raw string and handled the parsing myself to work around that.

Updated the variableRoutes and queryParams unit tests to make sure they properly provide decoded values to the application code