Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Headers = Headers [Header]
- newtype HeadersTransformFn = AddReplaceOrRemove AddReplaceOrRemoveFields
- data AddReplaceOrRemoveFields = AddReplaceOrRemoveFields {
- addOrReplaceHeaders :: [(CI Text, UnescapedTemplate)]
- removeHeaders :: [CI Text]
- applyHeadersTransformFn :: MonadError TransformErrorBundle m => HeadersTransformFn -> RequestTransformCtx -> Headers -> m Headers
- validateHeadersTransformFn :: TemplatingEngine -> HeadersTransformFn -> Validation TransformErrorBundle ()
- newtype HeaderKey = HeaderKey {
- unHeaderKey :: CI Text
Documentation
The actual header data we are transforming..
This newtype is necessary because otherwise we end up with an orphan instance.
Headers [Header] |
Instances
newtype HeadersTransformFn Source #
The defunctionalized transformation on Headers
AddReplaceOrRemove AddReplaceOrRemoveFields | Add or replace matching |
Instances
data AddReplaceOrRemoveFields Source #
The user can supply a set of header keys to be filtered from the request and a set of headers to be added to the request.
AddReplaceOrRemoveFields | |
|
Instances
applyHeadersTransformFn :: MonadError TransformErrorBundle m => HeadersTransformFn -> RequestTransformCtx -> Headers -> m Headers Source #
Provide an implementation for the transformations defined by
HeadersTransformFn
.
If one views HeadersTransformFn
as an interface describing HTTP message
header transformations, this can be seen as an implementation of these
transformations as normal Haskell functions.
validateHeadersTransformFn :: TemplatingEngine -> HeadersTransformFn -> Validation TransformErrorBundle () Source #
Validate that the provided HeadersTransformFn
is correct in the context
of a particular TemplatingEngine
.
This is a product of the fact that the correctness of a given transformation
may be dependent on zero, one, or more of the templated transformations
encoded within the given HeadersTransformFn
.
This newtype exists solely to anchor a FromJSON
instance and is
eliminated in the TransformHeaders
FromJSON
instance.
HeaderKey | |
|