@@ -102,8 +102,12 @@ setPath req path = req {
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 }
108+ dropFrontSlash ("":"":[]) = [] -- homepage, a single slash
109+ dropFrontSlash ("":path) = path
110+ dropFrontSlash path = path
108srequest :: SRequest -> Session SResponse
112srequest :: SRequest -> Session SResponse
109srequest (SRequest req bod) = do
113srequest (SRequest req bod) = do