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.

  1. updateHeaders :: HasHeaders a => (Headers -> Headers) -> a -> a

    snap-core Snap.Core

    Modify the datatype's headers.

  2. class HasHeaders a

    snap-core Snap.Internal.Core

    A typeclass for datatypes which contain HTTP headers.

  3. addHeader :: HasHeaders a => CI ByteString -> ByteString -> a -> a

    snap-core Snap.Internal.Core

    Adds a header key-value-pair to the HasHeaders datatype. If a header with the same name already exists, the new value is appended to the headers list. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> addHeader "Host" "localhost" H.empty
    H {unH = [("host","localhost")]}
    ghci> addHeader "Host" "127.0.0.1" it
    H {unH = [("host","localhost,127.0.0.1")]}
    

  4. deleteHeader :: HasHeaders a => CI ByteString -> a -> a

    snap-core Snap.Internal.Core

    Clears a header value from a HasHeaders datatype. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> deleteHeader "Host" $ setHeader "Host" "localhost" H.empty
    H {unH = []}
    

  5. getHeader :: HasHeaders a => CI ByteString -> a -> Maybe ByteString

    snap-core Snap.Internal.Core

    Gets a header value out of a HasHeaders datatype. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> getHeader "Host" $ setHeader "Host" "localhost" H.empty
    Just "localhost"
    

  6. ipHeaderFilter :: MonadSnap m => m ()

    snap-core Snap.Internal.Core

    Modifies the Request in the state to set the rqRemoteAddr field to the value in the X-Forwarded-For header. If the header is not present, this action has no effect. This action should be used only when working behind a reverse http proxy that sets the X-Forwarded-For header. This is the only way to ensure the value in the X-Forwarded-For header can be trusted. This is provided as a filter so actions that require the remote address can get it in a uniform manner. It has specifically limited functionality to ensure that its transformation can be trusted, when used correctly.

  7. ipHeaderFilter' :: MonadSnap m => CI ByteString -> m ()

    snap-core Snap.Internal.Core

    Modifies the Request in the state to set the rqRemoteAddr field to the value from the header specified. If the header specified is not present, this action has no effect. This action should be used only when working behind a reverse http proxy that sets the header being looked at. This is the only way to ensure the value in the header can be trusted. This is provided as a filter so actions that require the remote address can get it in a uniform manner. It has specifically limited functionality to ensure that its transformation can be trusted, when used correctly.

  8. listHeaders :: HasHeaders a => a -> [(CI ByteString, ByteString)]

    snap-core Snap.Internal.Core

    Lists all the headers out of a HasHeaders datatype. If many headers came in with the same name, they will be catenated together. Example:

    ghci> import qualified Snap.Types.Headers as H
    ghci> listHeaders $ setHeader "Host" "localhost" H.empty
    [("host","localhost")]
    

  9. rqHeaders :: Request -> Headers

    snap-core Snap.Internal.Core

    Contains all HTTP Headers associated with this request. Example:

    ghci> :set -XOverloadedStrings
    ghci> import qualified Snap.Test as T
    ghci> import qualified Data.Map as M
    ghci> rqHeaders `fmap` T.buildRequest (T.get "/foo/bar" M.empty)
    H {unH = [("host","localhost")]}
    

  10. rspHeaders :: Response -> Headers

    snap-core Snap.Internal.Core

    No documentation available.

Page 187 of many | Previous | Next