on master help sign in
Merge branch 'master' of github.com:yesodweb/wai
671720eMichael Snoyman
wai-test/Network/Wai/Test.hs+6−2
@@ -102,8 +102,12 @@ setPath req path = req {
102
102
103setRawPathInfo :: Request -> S8.ByteString -> Request
103setRawPathInfo :: Request -> S8.ByteString -> Request
104setRawPathInfo r rawPinfo =
104setRawPathInfo r rawPinfo =
105− let pInfo = T.split (== '/') $ TE.decodeUtf8 rawPinfo
105+ let pInfo = dropFrontSlash $ T.split (== '/') $ TE.decodeUtf8 rawPinfo
106− in r { rawPathInfo = rawPinfo, pathInfo = pInfo }
106+ in r { rawPathInfo = rawPinfo, pathInfo = pInfo }
107+ where
108+ dropFrontSlash ("":"":[]) = [] -- homepage, a single slash
109+ dropFrontSlash ("":path) = path
110+ dropFrontSlash path = path
107
111
108srequest :: SRequest -> Session SResponse
112srequest :: SRequest -> Session SResponse
109srequest (SRequest req bod) = do
113srequest (SRequest req bod) = do
wai-test/wai-test.cabal+1−1
@@ -1,5 +1,5 @@
1name: wai-test
1name: wai-test
2−version: 1.3.1
2+version: 1.3.1.1
3license: MIT
3license: MIT
4license-file: LICENSE
4license-file: LICENSE
5author: Michael Snoyman <michael@snoyman.com>
5author: Michael Snoyman <michael@snoyman.com>