Another fix for UTF8 paths
This commit is contained in:
parent
68c02c3289
commit
8c183d9cda
@ -504,7 +504,7 @@ setUrl url' = do
|
|||||||
let (urlPath, urlQuery) = T.break (== '?') url
|
let (urlPath, urlQuery) = T.break (== '?') url
|
||||||
ST.modify $ \rbd -> rbd
|
ST.modify $ \rbd -> rbd
|
||||||
{ rbdPath =
|
{ rbdPath =
|
||||||
case DL.filter (/="") $ T.split (== '/') urlPath of
|
case DL.filter (/="") $ H.decodePathSegments $ TE.encodeUtf8 urlPath of
|
||||||
("http:":_:rest) -> rest
|
("http:":_:rest) -> rest
|
||||||
("https:":_:rest) -> rest
|
("https:":_:rest) -> rest
|
||||||
x -> x
|
x -> x
|
||||||
|
|||||||
@ -113,6 +113,11 @@ main = hspec $ do
|
|||||||
get ("/dynamic1/שלום" :: Text)
|
get ("/dynamic1/שלום" :: Text)
|
||||||
statusIs 200
|
statusIs 200
|
||||||
bodyEquals "שלום"
|
bodyEquals "שלום"
|
||||||
|
yit "from path, type-safe URL" $ do
|
||||||
|
get $ LiteAppRoute ["dynamic1", "שלום"]
|
||||||
|
statusIs 200
|
||||||
|
printBody
|
||||||
|
bodyEquals "שלום"
|
||||||
yit "from WAI" $ do
|
yit "from WAI" $ do
|
||||||
get ("/dynamic2/שלום" :: Text)
|
get ("/dynamic2/שלום" :: Text)
|
||||||
statusIs 200
|
statusIs 200
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-test
|
name: yesod-test
|
||||||
version: 1.2.1.3
|
version: 1.2.1.4
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Nubis <nubis@woobiz.com.ar>
|
author: Nubis <nubis@woobiz.com.ar>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user