on master help sign in
Version bump and changelog
bb2ba5dpatrick brisbin
wai-extra/ChangeLog.md+4
@@ -1,3 +1,7 @@
1+## 3.0.24.0
2+
3+* Add timeout middleware [#702](https://github.com/yesodweb/wai/pull/702).
4+
1## 3.0.23.0
5## 3.0.23.0
2
6
3* Add rewriteRoot middleware [#697](https://github.com/yesodweb/wai/pull/697).
7* Add rewriteRoot middleware [#697](https://github.com/yesodweb/wai/pull/697).
wai-extra/Network/Wai/Middleware/Timeout.hs+5−3
@@ -1,7 +1,4 @@
1-- | Timeout requests
1-- | Timeout requests
2−--
3−-- @since X.X.X@
4−--
5module Network.Wai.Middleware.Timeout
2module Network.Wai.Middleware.Timeout
6 ( timeout
3 ( timeout
7 , timeoutStatus
4 , timeoutStatus
@@ -17,14 +14,19 @@ import qualified System.Timeout as Timeout
17-- Timeouts respond with @'status503'@. See @'timeoutStatus'@ or @'timeoutAs'@
14-- Timeouts respond with @'status503'@. See @'timeoutStatus'@ or @'timeoutAs'@
18-- to customize the behavior of the timed-out case.
15-- to customize the behavior of the timed-out case.
19--
16--
17+-- @since 3.0.24.0@
20timeout :: Int -> Middleware
18timeout :: Int -> Middleware
21timeout = timeoutStatus status503
19timeout = timeoutStatus status503
22
20
23-- | Time out with the given @'Status'@
21-- | Time out with the given @'Status'@
22+--
23+-- @since 3.0.24.0@
24timeoutStatus :: Status -> Int -> Middleware
24timeoutStatus :: Status -> Int -> Middleware
25timeoutStatus status = timeoutAs $ responseLBS status [] ""
25timeoutStatus status = timeoutAs $ responseLBS status [] ""
26
26
27-- | Time out with the given @'Response'@
27-- | Time out with the given @'Response'@
28+--
29+-- @since 3.0.24.0@
28timeoutAs :: Response -> Int -> Middleware
30timeoutAs :: Response -> Int -> Middleware
29timeoutAs timeoutReponse seconds app req respond =
31timeoutAs timeoutReponse seconds app req respond =
30 maybe (respond timeoutReponse) pure
32 maybe (respond timeoutReponse) pure
wai-extra/wai-extra.cabal+1−1
@@ -1,5 +1,5 @@
1Name: wai-extra
1Name: wai-extra
2−Version: 3.0.23.0
2+Version: 3.0.24.0
3Synopsis: Provides some basic WAI handlers and middleware.
3Synopsis: Provides some basic WAI handlers and middleware.
4description:
4description:
5 Provides basic WAI handler and middleware functionality:
5 Provides basic WAI handler and middleware functionality: