@@ -1,3 +1,6 @@
1+-- |
2+--
3+-- @since 3.0.14
14module Network.Wai.Middleware.ForceDomain where
25
36import Data.ByteString (ByteString)
@@ -11,6 +14,8 @@ import Network.Wai.Request
1114-- | Force a domain by redirecting.
1215-- The `checkDomain` function takes the current domain and checks whether it is correct.
1316-- It should return `Nothing` if the domain is correct, or `Just "domain.com"` if it is incorrect.
17+--
18+-- @since 3.0.14
1419forceDomain :: (ByteString -> Maybe ByteString) -> Middleware
1520forceDomain checkDomain app req sendResponse =
1621 case requestHeaderHost req >>= checkDomain of