Hoogle Search
Within LTS Haskell 24.58 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
parseHeaderWithPrefix :: FromHttpApiData a => ByteString -> ByteString -> Either Text ahttp-api-data Web.Internal.HttpApiData Parse given bytestring then parse the rest of the input using parseHeader.
data BasicAuthToken = BasicAuthToken Text deriving (Show) instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h parseQueryParam p = BasicAuthToken <$> parseQueryParam p
>>> parseHeader "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" :: Either Text BasicAuthToken Right (BasicAuthToken "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
toHeader :: ToHttpApiData a => a -> ByteStringhttp-api-data Web.Internal.HttpApiData Convert to HTTP header value.
replaceHeader :: HeaderName -> ByteString -> [Header] -> [Header]wai-extra Network.Wai.Header No documentation available.
module Network.Wai.Middleware.
AddHeaders Since 3.0.3
addHeaders :: [(ByteString, ByteString)] -> Middlewarewai-extra Network.Wai.Middleware.AddHeaders Prepend a list of headers without any checks Since 3.0.3
module Network.Wai.Middleware.
Autohead Automatically produce responses to HEAD requests based on the underlying applications GET response.
-
wai-extra Network.Wai.Middleware.Autohead No documentation available.
module Network.Wai.Middleware.
CombineHeaders Sometimes incoming requests don't stick to the "no duplicate headers" invariant, for a number of possible reasons (e.g. proxy servers blindly adding headers), or your application (or other middleware) blindly adds headers. In those cases, you can use this Middleware to make sure that headers that can be combined are combined. (e.g. applications might only check the first "Accept" header and fail, while there might be another one that would match)
combineHeaders :: CombineSettings -> Middlewarewai-extra Network.Wai.Middleware.CombineHeaders This middleware will reorganize the incoming and/or outgoing headers in such a way that it combines any duplicates of headers that, on their own, can normally have more than one value, and any other headers will stay untouched. This middleware WILL change the global order of headers (they will be put in alphabetical order), but keep the order of the same type of header. I.e. if there are 3 "Set-Cookie" headers, the first one will still be first, the second one will still be second, etc. But now they are guaranteed to be next to each other. N.B. This Middleware assumes the headers it combines are correctly formatted. If one of the to-be-combined headers is malformed, the new combined header will also (probably) be malformed.
-
wai-extra Network.Wai.Middleware.CombineHeaders The default collection of HTTP headers that can be combined in case there are multiples in one request or response. See the documentation of defaultCombineSettings for the exact list.