wai-middleware-throttle 0.3.0.0 → 0.3.0.1
raw patch · 2 files changed
+6/−6 lines, 2 filesdep ~networkPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: network
API changes (from Hackage documentation)
- Network.Wai.Middleware.Throttle: Throttle :: ThrottleSettings -> Cache a (CacheState TokenBucket) -> Request -> Either Response a -> Throttle a
+ Network.Wai.Middleware.Throttle: Throttle :: ThrottleSettings -> Cache a (CacheState TokenBucket) -> (Request -> Either Response a) -> Throttle a
- Network.Wai.Middleware.Throttle: ThrottleSettings :: Double -> Double -> Word64 -> TimeSpec -> Request -> Bool -> Word64 -> Response -> ThrottleSettings
+ Network.Wai.Middleware.Throttle: ThrottleSettings :: Double -> Double -> Word64 -> TimeSpec -> (Request -> Bool) -> (Word64 -> Response) -> ThrottleSettings
- Network.Wai.Middleware.Throttle.Internal: Throttle :: ThrottleSettings -> Cache a (CacheState TokenBucket) -> Request -> Either Response a -> Throttle a
+ Network.Wai.Middleware.Throttle.Internal: Throttle :: ThrottleSettings -> Cache a (CacheState TokenBucket) -> (Request -> Either Response a) -> Throttle a
- Network.Wai.Middleware.Throttle.Internal: ThrottleSettings :: Double -> Double -> Word64 -> TimeSpec -> Request -> Bool -> Word64 -> Response -> ThrottleSettings
+ Network.Wai.Middleware.Throttle.Internal: ThrottleSettings :: Double -> Double -> Word64 -> TimeSpec -> (Request -> Bool) -> (Word64 -> Response) -> ThrottleSettings
Files
Network/Wai/Middleware/Throttle/Internal.hs view
@@ -14,7 +14,7 @@ import GHC.Word (Word64) import Network.HTTP.Types.Status (status429) import Network.Socket (SockAddr (SockAddrInet, SockAddrInet6, SockAddrUnix))-#if MIN_VERSION_network(2,6,1)+#if MIN_VERSION_network(2,6,1) && ! MIN_VERSION_network(3,0,0) import Network.Socket (SockAddr (SockAddrCan)) #endif import Network.Wai (Application, Request, Response, remoteHost, responseLBS)@@ -26,7 +26,7 @@ hashWithSalt s (Address (SockAddrInet _ a)) = hashWithSalt s a hashWithSalt s (Address (SockAddrInet6 _ _ a _)) = hashWithSalt s a hashWithSalt s (Address (SockAddrUnix a)) = hashWithSalt s a-#if MIN_VERSION_network(2,6,1)+#if MIN_VERSION_network(2,6,1) && ! MIN_VERSION_network(3,0,0) hashWithSalt s (Address (SockAddrCan a)) = hashWithSalt s a #endif @@ -34,7 +34,7 @@ Address (SockAddrInet _ a) == Address (SockAddrInet _ b) = a == b Address (SockAddrInet6 _ _ a _) == Address (SockAddrInet6 _ _ b _) = a == b Address (SockAddrUnix a) == Address (SockAddrUnix b) = a == b-#if MIN_VERSION_network(2,6,1)+#if MIN_VERSION_network(2,6,1) && ! MIN_VERSION_network(3,0,0) Address (SockAddrCan a) == Address (SockAddrCan b) = a == b #endif _ == _ = False -- not same constructor so cant be equal@@ -43,7 +43,7 @@ Address (SockAddrInet _ a) <= Address (SockAddrInet _ b) = a <= b Address (SockAddrInet6 _ _ a _) <= Address (SockAddrInet6 _ _ b _) = a <= b Address (SockAddrUnix a) <= Address (SockAddrUnix b) = a <= b-#if MIN_VERSION_network(2,6,1)+#if MIN_VERSION_network(2,6,1) && ! MIN_VERSION_network(3,0,0) Address (SockAddrCan a) <= Address (SockAddrCan b) = a <= b #endif Address a <= Address b = a <= b -- not same constructor so use builtin ordering
wai-middleware-throttle.cabal view
@@ -1,5 +1,5 @@ name: wai-middleware-throttle-version: 0.3.0.0+version: 0.3.0.1 license: BSD3 license-file: LICENSE author: Christopher Reichert@@ -34,7 +34,7 @@ , hashable >= 1.2 , http-types , mtl- , network >= 2.1+ , network >= 2.4.2 && <3.2 , safe-exceptions , stm , text