@@ -7,9 +7,12 @@ import Network.URI (unEscapeString)
77-- | Performs redirects as per 'splitPath'.
88cleanPathRel :: B.ByteString -> ([String] -> Request -> IO Response) -> Request -> IO Response
99cleanPathRel prefix app env =
10− case splitPath (prefix `B.append` (pathInfo env)) of
10+ case splitPath $ pathInfo env of
1111 Right pieces -> app pieces env
12− Left p -> return . Response Status301 [(Location, B.append p suffix)] $ Right emptyEnum
12+ Left p -> return
13+ . Response Status301
14+ [(Location, B.concat [prefix, p, suffix])]
15+ $ Right emptyEnum
1316 where
1417 -- include the query string if present
1518 suffix =