hack-middleware-cleanpath-0.0.1: Applies some basic redirect rules to get cleaner paths.

Hack.Middleware.CleanPath

Synopsis

Documentation

cleanPath :: MiddlewareSource

Performs redirects as per splitPath.

splitPath :: String -> Either String [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.