Safe Haskell | None |
---|---|
Language | Haskell2010 |
Serv.Internal.Cors
- type Policy = Config -> Context -> AccessSet
- class CorsPolicy m where
- data PermitAll
- headerSet :: Bool -> Context -> AccessSet -> [Header]
- data Context = Context {}
- mergeContext :: Context -> Context -> Context
- data AccessSet = AccessSet {}
- permitAll :: Policy
- wildcard :: Policy
- predicateWhitelist :: (Text -> Bool) -> Policy
Documentation
type Policy = Config -> Context -> AccessSet Source #
A CorsPolicy
interprets the request's provided Origin and the
current routing context to determine how to expose resources to the
requestor.
class CorsPolicy m where Source #
Class describing types which describe CORS Policy
s.
Minimal complete definition
Methods
corsPolicy :: Proxy m -> Policy Source #
Instances
Instances
The CorsContext
provides data from which we can make choices about
how to respond to CORS requests.
Constructors
Context | |
Fields |
Descrbes what parts of the response should be made available
cross-origin. The Monoid product on AccessSet
s permits all accesses of
either of the constituents.
Constructors
AccessSet | |
Fields |
The most permissive CORS Policy
possible. Differs from Wildcard in
that it allows credentials. Max age is not provided (so no caching)
Effects a wildcard policy which provides maximal cross-origin access to all request origins. This disallows credentials use, however.