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