wai-extra-0.0.0.2: Provides some basic WAI handlers and middleware.Source codeContentsIndex
Network.Wai.Middleware.CleanPath
Synopsis
cleanPath :: ([ByteString] -> Request -> IO Response) -> Request -> IO Response
splitPath :: ByteString -> Either ByteString [ByteString]
Documentation
cleanPath :: ([ByteString] -> Request -> IO Response) -> Request -> IO ResponseSource
Performs redirects as per splitPath.
splitPath :: ByteString -> Either ByteString [ByteString]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.
Produced by Haddock version 2.6.1