Another fix for UTF8 paths

This commit is contained in:
Michael Snoyman 2014-04-27 11:21:43 +03:00
parent 68c02c3289
commit 8c183d9cda
3 changed files with 7 additions and 2 deletions

View File

@ -504,7 +504,7 @@ setUrl url' = do
let (urlPath, urlQuery) = T.break (== '?') url
ST.modify $ \rbd -> rbd
{ rbdPath =
case DL.filter (/="") $ T.split (== '/') urlPath of
case DL.filter (/="") $ H.decodePathSegments $ TE.encodeUtf8 urlPath of
("http:":_:rest) -> rest
("https:":_:rest) -> rest
x -> x

View File

@ -113,6 +113,11 @@ main = hspec $ do
get ("/dynamic1/שלום" :: Text)
statusIs 200
bodyEquals "שלום"
yit "from path, type-safe URL" $ do
get $ LiteAppRoute ["dynamic1", "שלום"]
statusIs 200
printBody
bodyEquals "שלום"
yit "from WAI" $ do
get ("/dynamic2/שלום" :: Text)
statusIs 200

View File

@ -1,5 +1,5 @@
name: yesod-test
version: 1.2.1.3
version: 1.2.1.4
license: MIT
license-file: LICENSE
author: Nubis <nubis@woobiz.com.ar>