- cleanPath :: ([String] -> Request -> IO Response) -> Request -> IO Response
- cleanPathRel :: ByteString -> ([String] -> Request -> IO Response) -> Request -> IO Response
- cleanPathFunc :: (ByteString -> Either ByteString [String]) -> ByteString -> ([String] -> Request -> IO Response) -> Request -> IO Response
- splitPath :: ByteString -> Either ByteString [String]
Documentation
cleanPathRel :: ByteString -> ([String] -> Request -> IO Response) -> Request -> IO ResponseSource
Performs redirects as per splitPath
.
cleanPathFunc :: (ByteString -> Either ByteString [String]) -> ByteString -> ([String] -> Request -> IO Response) -> Request -> IO ResponseSource
splitPath :: ByteString -> Either ByteString [String]Source
Given a certain requested path, return either a corrected path to redirect to or the tokenized path.
This code corrects for the following issues:
- It is missing a trailing slash, and there is no period after the last slash.
- There are any doubled slashes.