webgear-core 1.0.4 → 1.0.5
raw patch · 13 files changed
+119/−14 lines, 13 filesdep ~basedep ~josedep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, jose, template-haskell
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−1
- src/WebGear/Core/Handler.hs +2/−0
- src/WebGear/Core/Trait.hs +19/−9
- src/WebGear/Core/Trait/Auth/Basic.hs +5/−0
- src/WebGear/Core/Trait/Auth/Common.hs +3/−0
- src/WebGear/Core/Trait/Auth/JWT.hs +5/−0
- src/WebGear/Core/Trait/Body.hs +11/−0
- src/WebGear/Core/Trait/Header.hs +7/−0
- src/WebGear/Core/Trait/Method.hs +1/−0
- src/WebGear/Core/Trait/Path.hs +3/−0
- src/WebGear/Core/Trait/QueryParam.hs +5/−0
- src/WebGear/Core/Trait/Status.hs +47/−0
- webgear-core.cabal +4/−4
CHANGELOG.md view
@@ -2,6 +2,11 @@ ## [Unreleased] +## [1.0.5] - 2023-05-04++### Changed+- Update dependency bounds and GHC versions+ ## [1.0.4] - 2022-08-27 ### Changed@@ -29,7 +34,8 @@ - Extracted webgear-core from webgear-server - New arrow based API -[Unreleased]: https://github.com/haskell-webgear/webgear/compare/v1.0.4...HEAD+[Unreleased]: https://github.com/haskell-webgear/webgear/compare/v1.0.5...HEAD+[1.0.5]: https://github.com/haskell-webgear/webgear/releases/tag/v1.0.5 [1.0.4]: https://github.com/haskell-webgear/webgear/releases/tag/v1.0.4 [1.0.3]: https://github.com/haskell-webgear/webgear/releases/tag/v1.0.3 [1.0.2]: https://github.com/haskell-webgear/webgear/releases/tag/v1.0.2
src/WebGear/Core/Handler.hs view
@@ -82,7 +82,9 @@ -- | Indicates that the request does not match the current handler. routeMismatch :: ArrowError RouteMismatch h => h a b routeMismatch = proc _a -> raise -< RouteMismatch+{-# INLINE routeMismatch #-} -- | Lifts `unlink` into a handler arrow. unlinkA :: Handler h m => h (Linked ts Response) Response unlinkA = arr unlink+{-# INLINE unlinkA #-}
src/WebGear/Core/Trait.hs view
@@ -1,4 +1,4 @@- {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE UndecidableInstances #-} {- | Traits are optional attributes associated with a value. For example, a list containing totally ordered values might have a@@ -77,14 +77,16 @@ -- with other traits h (Linked ts a, Attribute t a) (Linked (t : ts) a) --- | @Gets h ts a@ is equivalent to @(Get h t1 a, Get h t2 a, ..., Get--- h tn a)@ where @ts = [t1, t2, ..., tn]@.+{- | @Gets h ts a@ is equivalent to @(Get h t1 a, Get h t2 a, ..., Get+ h tn a)@ where @ts = [t1, t2, ..., tn]@.+-} type family Gets h ts a :: Constraint where Gets h '[] a = () Gets h (t : ts) a = (Get h t a, Gets h ts a) --- | @Sets h ts a@ is equivalent to @(Set h t1 a, Set h t2 a, ..., Set--- h tn a)@ where @ts = [t1, t2, ..., tn]@.+{- | @Sets h ts a@ is equivalent to @(Set h t1 a, Set h t2 a, ..., Set+ h tn a)@ where @ts = [t1, t2, ..., tn]@.+-} type family Sets h ts a :: Constraint where Sets h '[] a = () Sets h (t : ts) a = (Set h t a, Sets h ts a)@@ -92,8 +94,8 @@ -- | A value linked with a type-level list of traits. data Linked (ts :: [Type]) a = Linked { linkAttribute :: !(LinkedAttributes ts a)- , -- | Retrive the value from a linked value- unlink :: !a+ , unlink :: !a+ -- ^ Retrive the value from a linked value } type family LinkedAttributes (ts :: [Type]) (a :: Type) where@@ -103,10 +105,12 @@ -- | Wrap a value with an empty list of traits. linkzero :: a -> Linked '[] a linkzero = Linked ()+{-# INLINE linkzero #-} -- | Forget the head trait linkminus :: Linked (t : ts) a -> Linked ts a linkminus (Linked (_, rv) a) = Linked rv a+{-# INLINE linkminus #-} {- | Attempt to link an additional trait with an already linked value. This can fail indicating an 'Absence' of the trait.@@ -123,15 +127,18 @@ link :: (Linked ts a, Either e (Attribute t a)) -> Either e (Linked (t : ts) a) link (_, Left e) = Left e link (Linked{..}, Right attr) = Right $ Linked{linkAttribute = (attr, linkAttribute), ..}+{-# INLINE probe #-} --- | Set a trait attribute on linked value to produce another linked--- value+{- | Set a trait attribute on linked value to produce another linked+ value+-} plant :: forall t ts h a. Set h t a => t -> h (Linked ts a, Attribute t a) (Linked (t : ts) a) plant t = proc (l, attr) -> do setTrait t link -< (l, attr) where link :: Linked ts a -> a -> Attribute t a -> Linked (t : ts) a link Linked{..} a' attr = Linked{linkAttribute = (attr, linkAttribute), unlink = a'}+{-# INLINE plant #-} {- | Constraint that proves that the trait @t@ is present in the list of traits @ts@.@@ -143,10 +150,12 @@ instance HasTrait t (t : ts) where from :: Linked (t : ts) a -> Tagged t (Attribute t a) from (Linked (lv, _) _) = Tagged lv+ {-# INLINE from #-} instance {-# OVERLAPPABLE #-} HasTrait t ts => HasTrait t (t' : ts) where from :: Linked (t' : ts) a -> Tagged t (Attribute t a) from l = from $ linkminus l+ {-# INLINE from #-} {- | Retrieve a trait. @@ -157,6 +166,7 @@ -} pick :: Tagged t a -> a pick = untag+{-# INLINE pick #-} -- For better type errors instance TypeError (MissingTrait t) => HasTrait t '[] where
src/WebGear/Core/Trait/Auth/Basic.hs view
@@ -147,6 +147,7 @@ case result of Left err -> errorHandler -< (request, err) Right val -> nextHandler -< val+{-# INLINE basicAuthMiddleware #-} {- | Middleware to add basic authentication protection for a handler. @@ -167,6 +168,7 @@ h (Linked req Request, BasicAuthError e) Response -> Middleware h req (BasicAuth m e t : req) basicAuth = basicAuth'+{-# INLINE basicAuth #-} {- | Similar to `basicAuth` but supports a custom authentication scheme. @@ -183,6 +185,7 @@ h (Linked req Request, BasicAuthError e) Response -> Middleware h req (BasicAuth' Required scheme m e t : req) basicAuth' = basicAuthMiddleware+{-# INLINE basicAuth' #-} {- | Middleware to add optional basic authentication protection for a handler. @@ -202,6 +205,7 @@ BasicAuth' Optional "Basic" m e t -> Middleware h req (BasicAuth' Optional "Basic" m e t : req) optionalBasicAuth = optionalBasicAuth'+{-# INLINE optionalBasicAuth #-} {- | Similar to `optionalBasicAuth` but supports a custom authentication scheme.@@ -217,3 +221,4 @@ BasicAuth' Optional scheme m e t -> Middleware h req (BasicAuth' Optional scheme m e t : req) optionalBasicAuth' cfg = basicAuthMiddleware cfg $ arr (absurd . snd)+{-# INLINE optionalBasicAuth' #-}
src/WebGear/Core/Trait/Auth/Common.hs view
@@ -46,6 +46,7 @@ getAuthorizationHeaderTrait = proc request -> do result <- getTrait (Header :: Header Optional Lenient "Authorization" (AuthToken scheme)) -< request returnA -< either absurd id result+{-# INLINE getAuthorizationHeaderTrait #-} -- | The protection space for authentication newtype Realm = Realm ByteString@@ -62,6 +63,7 @@ instance KnownSymbol scheme => FromHttpApiData (AuthToken scheme) where parseUrlPiece = parseHeader . encodeUtf8 + {-# INLINE parseHeader #-} parseHeader hdr = case break (== ' ') hdr of (scm, tok) ->@@ -98,3 +100,4 @@ <<< setHeader @"WWW-Authenticate" (respondA HTTP.unauthorized401 "text/plain") -< (headerVal, "Unauthorized" :: Text)+{-# INLINE respondUnauthorized #-}
src/WebGear/Core/Trait/Auth/JWT.hs view
@@ -152,6 +152,7 @@ h (WebGear.Core.Trait.Linked req Request, JWTAuthError e) Response -> Middleware h req (JWTAuth m e t : req) jwtAuth = jwtAuth' @"Bearer"+{-# INLINE jwtAuth #-} {- | Middleware to add optional JWT authentication protection for a handler. Expects the JWT to be available via a standard bearer@@ -176,6 +177,7 @@ JWTAuth' Optional "Bearer" m e t -> Middleware h req (JWTAuth' Optional "Bearer" m e t : req) optionalJWTAuth = optionalJWTAuth' @"Bearer"+{-# INLINE optionalJWTAuth #-} jwtAuthMiddleware :: forall s e t x h m req.@@ -191,6 +193,7 @@ case result of Left err -> errorHandler -< (request, err) Right val -> nextHandler -< val+{-# INLINE jwtAuthMiddleware #-} {- | Middleware to add JWT authentication protection for a handler. Expects the JWT to be available via an authorization header@@ -217,6 +220,7 @@ h (WebGear.Core.Trait.Linked req Request, JWTAuthError e) Response -> Middleware h req (JWTAuth' Required s m e t : req) jwtAuth' = jwtAuthMiddleware+{-# INLINE jwtAuth' #-} {- | Middleware to add JWT authentication protection for a handler. Expects the JWT to be available via an authorization header@@ -242,3 +246,4 @@ JWTAuth' Optional s m e t -> Middleware h req (JWTAuth' Optional s m e t : req) optionalJWTAuth' cfg = jwtAuthMiddleware cfg $ arr (absurd . snd)+{-# INLINE optionalJWTAuth' #-}
src/WebGear/Core/Trait/Body.hs view
@@ -104,6 +104,7 @@ case result of Left err -> errorHandler -< (request, err) Right t -> nextHandler -< t+{-# INLINE requestBody #-} {- | Parse the request body as JSON and convert it to a value of type @t@.@@ -128,6 +129,7 @@ case result of Left err -> errorHandler -< (request, err) Right t -> nextHandler -< t+{-# INLINE jsonRequestBody' #-} -- | Same as 'jsonRequestBody'' but with a media type @application/json@. jsonRequestBody ::@@ -137,6 +139,7 @@ h (Linked req Request, Text) Response -> Middleware h req (JSONBody t : req) jsonRequestBody = jsonRequestBody' (Just "application/json")+{-# INLINE jsonRequestBody #-} {- | Set the response body along with a media type. @@ -154,6 +157,7 @@ r' <- plant (Body (Just mediaType)) -< (r, body) let mt = decodeUtf8 $ HTTP.renderHeader mediaType plant Header -< (r', mt)+{-# INLINE setBody #-} -- | Set the response body without specifying any media type. setBodyWithoutContentType ::@@ -164,6 +168,7 @@ setBodyWithoutContentType prevHandler = proc (body, a) -> do r <- prevHandler -< a plant (Body Nothing) -< (r, body)+{-# INLINE setBodyWithoutContentType #-} {- | Set the response body to a JSON value along with a media type. @@ -181,6 +186,7 @@ r' <- plant (JSONBody (Just mediaType)) -< (r, body) let mt = decodeUtf8 $ HTTP.renderHeader mediaType plant Header -< (r', mt)+{-# INLINE setJSONBody' #-} {- | Set the response body to a JSON value. @@ -192,6 +198,7 @@ h a (Linked ts Response) -> h (body, a) (Linked (RequiredHeader "Content-Type" Text : JSONBody body : ts) Response) setJSONBody = setJSONBody' "application/json"+{-# INLINE setJSONBody #-} {- | Set the response body to a JSON value without specifying any media type.@@ -204,6 +211,7 @@ setJSONBodyWithoutContentType prevHandler = proc (body, a) -> do r <- prevHandler -< a plant (JSONBody Nothing) -< (r, body)+{-# INLINE setJSONBodyWithoutContentType #-} {- | A convenience arrow to generate a response specifying a status and body. @@ -220,6 +228,7 @@ h body (Linked [RequiredHeader "Content-Type" Text, Body body, Status] Response) respondA status mediaType = proc body -> setBody mediaType (mkResponse status) -< (body, ())+{-# INLINE respondA #-} {- | A convenience arrow to generate a response specifying a status and JSON body.@@ -233,6 +242,7 @@ HTTP.Status -> h body (Linked [RequiredHeader "Content-Type" Text, JSONBody body, Status] Response) respondJsonA status = respondJsonA' status "application/json"+{-# INLINE respondJsonA #-} {- | A convenience arrow to generate a response specifying a status and JSON body.@@ -250,3 +260,4 @@ h body (Linked [RequiredHeader "Content-Type" Text, JSONBody body, Status] Response) respondJsonA' status mediaType = proc body -> setJSONBody' mediaType (mkResponse status) -< (body, ())+{-# INLINE respondJsonA' #-}
src/WebGear/Core/Trait/Header.hs view
@@ -109,6 +109,7 @@ case result of Left err -> errorHandler -< (request, err) Right val -> nextHandler -< val+{-# INLINE headerHandler #-} {- | Extract a header value and convert it to a value of type @val@. @@ -125,6 +126,7 @@ h (Linked req Request, Either HeaderNotFound HeaderParseError) Response -> Middleware h req (Header Required Strict name val : req) header = headerHandler+{-# INLINE header #-} {- | Extract an optional header value and convert it to a value of type @val@.@@ -143,6 +145,7 @@ h (Linked req Request, HeaderParseError) Response -> Middleware h req (Header Optional Strict name val : req) optionalHeader = headerHandler+{-# INLINE optionalHeader #-} {- | Extract a header value and convert it to a value of type @val@. @@ -161,6 +164,7 @@ h (Linked req Request, HeaderNotFound) Response -> Middleware h req (Header Required Lenient name val : req) lenientHeader = headerHandler+{-# INLINE lenientHeader #-} {- | Extract a header value and convert it to a value of type @val@. @@ -177,6 +181,7 @@ (Get h (Header Optional Lenient name val) Request, ArrowChoice h) => Middleware h req (Header Optional Lenient name val : req) optionalLenientHeader = headerHandler $ arr (absurd . snd)+{-# INLINE optionalLenientHeader #-} instance Trait (Header Required Strict name val) Response where type Attribute (Header Required Strict name val) Response = val@@ -198,6 +203,7 @@ setHeader prevHandler = proc (val, a) -> do r <- prevHandler -< a plant Header -< (r, val)+{-# INLINE setHeader #-} {- | Set an optional header value in a response. @@ -217,3 +223,4 @@ setOptionalHeader prevHandler = proc (val, a) -> do r <- prevHandler -< a plant Header -< (r, val)+{-# INLINE setOptionalHeader #-}
src/WebGear/Core/Trait/Method.hs view
@@ -45,3 +45,4 @@ HTTP.StdMethod -> Middleware h req (Method : req) method m nextHandler = probe (Method m) >>> routeMismatch ||| nextHandler+{-# INLINE method #-}
src/WebGear/Core/Trait/Path.hs view
@@ -85,6 +85,7 @@ Text -> Middleware h req (Path : req) path s nextHandler = probe (Path s) >>> routeMismatch ||| nextHandler+{-# INLINE path #-} {- | A middleware that captures a path variable from a single path component.@@ -103,12 +104,14 @@ (Get h (PathVar tag val) Request, ArrowChoice h, ArrowError RouteMismatch h) => Middleware h req (PathVar tag val : req) pathVar nextHandler = probe PathVar >>> routeMismatch ||| nextHandler+{-# INLINE pathVar #-} -- | A middleware that verifies that end of path is reached. pathEnd :: (Get h PathEnd Request, ArrowChoice h, ArrowError RouteMismatch h) => Middleware h req (PathEnd : req) pathEnd nextHandler = probe PathEnd >>> routeMismatch ||| nextHandler+{-# INLINE pathEnd #-} {- | Produces middleware(s) to match an optional HTTP method and some path components.
src/WebGear/Core/Trait/QueryParam.hs view
@@ -101,6 +101,7 @@ case result of Left err -> errorHandler -< (request, err) Right val -> nextHandler -< val+{-# INLINE queryParamHandler #-} {- | Extract a query parameter and convert it to a value of type @val@.@@ -117,6 +118,7 @@ h (Linked req Request, Either ParamNotFound ParamParseError) Response -> Middleware h req (QueryParam Required Strict name val : req) queryParam = queryParamHandler+{-# INLINE queryParam #-} {- | Extract an optional query parameter and convert it to a value of type @val@.@@ -134,6 +136,7 @@ h (Linked req Request, ParamParseError) Response -> Middleware h req (QueryParam Optional Strict name val : req) optionalQueryParam = queryParamHandler+{-# INLINE optionalQueryParam #-} {- | Extract a query parameter and convert it to a value of type @val@. @@ -151,6 +154,7 @@ h (Linked req Request, ParamNotFound) Response -> Middleware h req (QueryParam Required Lenient name val : req) lenientQueryParam = queryParamHandler+{-# INLINE lenientQueryParam #-} {- | Extract a query parameter and convert it to a value of type @val@. @@ -167,3 +171,4 @@ (Get h (QueryParam Optional Lenient name val) Request, ArrowChoice h) => Middleware h req (QueryParam Optional Lenient name val : req) optionalLenientQueryParam = queryParamHandler $ arr (absurd . snd)+{-# INLINE optionalLenientQueryParam #-}
src/WebGear/Core/Trait/Status.hs view
@@ -67,187 +67,234 @@ mkResponse status = proc () -> do let response = linkzero $ Response status [] Nothing plant (Status status) -< (response, status)+{-# INLINE mkResponse #-} -- | Continue 100 response continue100 :: Set h Status Response => h () (Linked '[Status] Response) continue100 = mkResponse HTTP.continue100+{-# INLINE continue100 #-} -- | Switching Protocols 101 response switchingProtocols101 :: Set h Status Response => h () (Linked '[Status] Response) switchingProtocols101 = mkResponse HTTP.switchingProtocols101+{-# INLINE switchingProtocols101 #-} -- | OK 200 response ok200 :: Set h Status Response => h () (Linked '[Status] Response) ok200 = mkResponse HTTP.ok200+{-# INLINE ok200 #-} -- | Created 201 response created201 :: Set h Status Response => h () (Linked '[Status] Response) created201 = mkResponse HTTP.created201+{-# INLINE created201 #-} -- | Accepted 202 response accepted202 :: Set h Status Response => h () (Linked '[Status] Response) accepted202 = mkResponse HTTP.accepted202+{-# INLINE accepted202 #-} -- | Non-Authoritative 203 response nonAuthoritative203 :: Set h Status Response => h () (Linked '[Status] Response) nonAuthoritative203 = mkResponse HTTP.nonAuthoritative203+{-# INLINE nonAuthoritative203 #-} -- | No Content 204 response noContent204 :: Set h Status Response => h () (Linked '[Status] Response) noContent204 = mkResponse HTTP.noContent204+{-# INLINE noContent204 #-} -- | Reset Content 205 response resetContent205 :: Set h Status Response => h () (Linked '[Status] Response) resetContent205 = mkResponse HTTP.resetContent205+{-# INLINE resetContent205 #-} -- | Partial Content 206 response partialContent206 :: Set h Status Response => h () (Linked '[Status] Response) partialContent206 = mkResponse HTTP.partialContent206+{-# INLINE partialContent206 #-} -- | Multiple Choices 300 response multipleChoices300 :: Set h Status Response => h () (Linked '[Status] Response) multipleChoices300 = mkResponse HTTP.multipleChoices300+{-# INLINE multipleChoices300 #-} -- | Moved Permanently 301 response movedPermanently301 :: Set h Status Response => h () (Linked '[Status] Response) movedPermanently301 = mkResponse HTTP.movedPermanently301+{-# INLINE movedPermanently301 #-} -- | Found 302 response found302 :: Set h Status Response => h () (Linked '[Status] Response) found302 = mkResponse HTTP.found302+{-# INLINE found302 #-} -- | See Other 303 response seeOther303 :: Set h Status Response => h () (Linked '[Status] Response) seeOther303 = mkResponse HTTP.seeOther303+{-# INLINE seeOther303 #-} -- | Not Modified 304 response notModified304 :: Set h Status Response => h () (Linked '[Status] Response) notModified304 = mkResponse HTTP.notModified304+{-# INLINE notModified304 #-} -- | Temporary Redirect 307 response temporaryRedirect307 :: Set h Status Response => h () (Linked '[Status] Response) temporaryRedirect307 = mkResponse HTTP.temporaryRedirect307+{-# INLINE temporaryRedirect307 #-} -- | Permanent Redirect 308 response permanentRedirect308 :: Set h Status Response => h () (Linked '[Status] Response) permanentRedirect308 = mkResponse HTTP.permanentRedirect308+{-# INLINE permanentRedirect308 #-} -- | Bad Request 400 response badRequest400 :: Set h Status Response => h () (Linked '[Status] Response) badRequest400 = mkResponse HTTP.badRequest400+{-# INLINE badRequest400 #-} -- | Unauthorized 401 response unauthorized401 :: Set h Status Response => h () (Linked '[Status] Response) unauthorized401 = mkResponse HTTP.unauthorized401+{-# INLINE unauthorized401 #-} -- | Payment Required 402 response paymentRequired402 :: Set h Status Response => h () (Linked '[Status] Response) paymentRequired402 = mkResponse HTTP.paymentRequired402+{-# INLINE paymentRequired402 #-} -- | Forbidden 403 response forbidden403 :: Set h Status Response => h () (Linked '[Status] Response) forbidden403 = mkResponse HTTP.forbidden403+{-# INLINE forbidden403 #-} -- | Not Found 404 response notFound404 :: Set h Status Response => h () (Linked '[Status] Response) notFound404 = mkResponse HTTP.notFound404+{-# INLINE notFound404 #-} -- | Method Not Allowed 405 response methodNotAllowed405 :: Set h Status Response => h () (Linked '[Status] Response) methodNotAllowed405 = mkResponse HTTP.methodNotAllowed405+{-# INLINE methodNotAllowed405 #-} -- | Not Acceptable 406 response notAcceptable406 :: Set h Status Response => h () (Linked '[Status] Response) notAcceptable406 = mkResponse HTTP.notAcceptable406+{-# INLINE notAcceptable406 #-} -- | Proxy Authentication Required 407 response proxyAuthenticationRequired407 :: Set h Status Response => h () (Linked '[Status] Response) proxyAuthenticationRequired407 = mkResponse HTTP.proxyAuthenticationRequired407+{-# INLINE proxyAuthenticationRequired407 #-} -- | Request Timeout 408 response requestTimeout408 :: Set h Status Response => h () (Linked '[Status] Response) requestTimeout408 = mkResponse HTTP.requestTimeout408+{-# INLINE requestTimeout408 #-} -- | Conflict 409 response conflict409 :: Set h Status Response => h () (Linked '[Status] Response) conflict409 = mkResponse HTTP.conflict409+{-# INLINE conflict409 #-} -- | Gone 410 response gone410 :: Set h Status Response => h () (Linked '[Status] Response) gone410 = mkResponse HTTP.gone410+{-# INLINE gone410 #-} -- | Length Required 411 response lengthRequired411 :: Set h Status Response => h () (Linked '[Status] Response) lengthRequired411 = mkResponse HTTP.lengthRequired411+{-# INLINE lengthRequired411 #-} -- | Precondition Failed 412 response preconditionFailed412 :: Set h Status Response => h () (Linked '[Status] Response) preconditionFailed412 = mkResponse HTTP.preconditionFailed412+{-# INLINE preconditionFailed412 #-} -- | Request Entity Too Large 413 response requestEntityTooLarge413 :: Set h Status Response => h () (Linked '[Status] Response) requestEntityTooLarge413 = mkResponse HTTP.requestEntityTooLarge413+{-# INLINE requestEntityTooLarge413 #-} -- | Request URI Too Long 414 response requestURITooLong414 :: Set h Status Response => h () (Linked '[Status] Response) requestURITooLong414 = mkResponse HTTP.requestURITooLong414+{-# INLINE requestURITooLong414 #-} -- | Unsupported Media Type 415 response unsupportedMediaType415 :: Set h Status Response => h () (Linked '[Status] Response) unsupportedMediaType415 = mkResponse HTTP.unsupportedMediaType415+{-# INLINE unsupportedMediaType415 #-} -- | Requested Range Not Satisfiable 416 response requestedRangeNotSatisfiable416 :: Set h Status Response => h () (Linked '[Status] Response) requestedRangeNotSatisfiable416 = mkResponse HTTP.requestedRangeNotSatisfiable416+{-# INLINE requestedRangeNotSatisfiable416 #-} -- | Expectation Failed 417 response expectationFailed417 :: Set h Status Response => h () (Linked '[Status] Response) expectationFailed417 = mkResponse HTTP.expectationFailed417+{-# INLINE expectationFailed417 #-} -- | I'm A Teapot 418 response imATeapot418 :: Set h Status Response => h () (Linked '[Status] Response) imATeapot418 = mkResponse HTTP.imATeapot418+{-# INLINE imATeapot418 #-} -- | Unprocessable Entity 422 response unprocessableEntity422 :: Set h Status Response => h () (Linked '[Status] Response) unprocessableEntity422 = mkResponse HTTP.unprocessableEntity422+{-# INLINE unprocessableEntity422 #-} -- | Precondition Required 428 response preconditionRequired428 :: Set h Status Response => h () (Linked '[Status] Response) preconditionRequired428 = mkResponse HTTP.preconditionRequired428+{-# INLINE preconditionRequired428 #-} -- | Too Many Requests 429 response tooManyRequests429 :: Set h Status Response => h () (Linked '[Status] Response) tooManyRequests429 = mkResponse HTTP.tooManyRequests429+{-# INLINE tooManyRequests429 #-} -- | Request Header Fields Too Large 431 response requestHeaderFieldsTooLarge431 :: Set h Status Response => h () (Linked '[Status] Response) requestHeaderFieldsTooLarge431 = mkResponse HTTP.requestHeaderFieldsTooLarge431+{-# INLINE requestHeaderFieldsTooLarge431 #-} -- | Internal Server Error 500 response internalServerError500 :: Set h Status Response => h () (Linked '[Status] Response) internalServerError500 = mkResponse HTTP.internalServerError500+{-# INLINE internalServerError500 #-} -- | Not Implemented 501 response notImplemented501 :: Set h Status Response => h () (Linked '[Status] Response) notImplemented501 = mkResponse HTTP.notImplemented501+{-# INLINE notImplemented501 #-} -- | Bad Gateway 502 response badGateway502 :: Set h Status Response => h () (Linked '[Status] Response) badGateway502 = mkResponse HTTP.badGateway502+{-# INLINE badGateway502 #-} -- | Service Unavailable 503 response serviceUnavailable503 :: Set h Status Response => h () (Linked '[Status] Response) serviceUnavailable503 = mkResponse HTTP.serviceUnavailable503+{-# INLINE serviceUnavailable503 #-} -- | Gateway Timeout 504 response gatewayTimeout504 :: Set h Status Response => h () (Linked '[Status] Response) gatewayTimeout504 = mkResponse HTTP.gatewayTimeout504+{-# INLINE gatewayTimeout504 #-} -- | HTTP Version Not Supported 505 response httpVersionNotSupported505 :: Set h Status Response => h () (Linked '[Status] Response) httpVersionNotSupported505 = mkResponse HTTP.httpVersionNotSupported505+{-# INLINE httpVersionNotSupported505 #-} -- | Network Authentication Required 511 response networkAuthenticationRequired511 :: Set h Status Response => h () (Linked '[Status] Response) networkAuthenticationRequired511 = mkResponse HTTP.networkAuthenticationRequired511+{-# INLINE networkAuthenticationRequired511 #-}
webgear-core.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: webgear-core-version: 1.0.4+version: 1.0.5 synopsis: Composable, type-safe library to build HTTP APIs description: WebGear is a library to for building composable, type-safe HTTP APIs.@@ -53,7 +53,7 @@ TypeApplications TypeFamilies TypeOperators- build-depends: base >=4.13.0.0 && <4.18+ build-depends: base >=4.13.0.0 && <4.19 , bytestring >=0.10.10.1 && <0.12 , case-insensitive ==1.2.* , filepath ==1.4.*@@ -63,7 +63,7 @@ , network ==3.1.* , safe-exceptions ==0.1.* , tagged ==0.8.*- , template-haskell >=2.15.0.0 && <2.20+ , template-haskell >=2.15.0.0 && <2.21 , text >=1.2.0.0 && <2.1 , unordered-containers ==0.2.* , wai ==3.2.*@@ -104,5 +104,5 @@ , WebGear.Core.Handler.Static hs-source-dirs: src build-depends: arrows ==0.4.*- , jose >=0.8.3.1 && <0.10+ , jose >=0.8.3.1 && <0.11 , mime-types ==0.1.*