@@ -32,7 +32,7 @@ import Data.IORef (atomicModifyIORef', newIORef)
3232-- force a non-SSL request to SSL by redirect. One can safely choose not to
3333-- redirect when the request /appears/ secure, even if it's actually not.
3434--
35−-- Since 3.0.7
35+-- @since 3.0.7
3636appearsSecure :: Request -> Bool
3737appearsSecure request = isSecure request || any (uncurry matchHeader)
3838 [ ("HTTPS" , (== "on"))
@@ -52,13 +52,15 @@ appearsSecure request = isSecure request || any (uncurry matchHeader)
5252-- application. For more information and relevant caveats, please see
5353-- "Network.Wai.Middleware.Approot".
5454--
55−-- Since 3.0.7
55+-- @since 3.0.7
5656guessApproot :: Request -> ByteString
5757guessApproot req =
5858 (if appearsSecure req then "https://" else "http://") `S.append`
5959 (fromMaybe "localhost" $ requestHeaderHost req)
6060
6161-- | see 'requestSizeCheck'
62+--
63+-- @since 3.0.15
6264data RequestSizeException
6365 = RequestSizeException Word64
6466 deriving (Eq, Ord, Typeable)
@@ -75,14 +77,16 @@ instance Show RequestSizeException where
7577-- but larger than limit, or it's unknown but we have received too many chunks,
7678-- a 'RequestSizeException' are thrown when user use @'requestBody'@ to extract
7779-- request body inside IO.
80+--
81+-- @since 3.0.15
7882requestSizeCheck :: Word64 -> Request -> IO Request
7983requestSizeCheck maxSize req =
8084 case requestBodyLength req of
81− KnownLength len ->
85+ KnownLength len ->
8286 if len > maxSize
8387 then return $ req { requestBody = throwIO (RequestSizeException maxSize) }
8488 else return req
85− ChunkedBody -> do
89+ ChunkedBody -> do
8690 currentSize <- newIORef 0
8791 return $ req
8892 { requestBody = do