Network.HPACK.Token

http2-1.6.0: HTTP/2.0 library including frames and HPACK

Safe Haskell | None
Language | Haskell2010

Network.HPACK.Token

Contents

- Data type
- Ix
- Utilities
- Defined tokens

Synopsis

- data Token = Token {
  - ix :: !Int
  - shouldBeIndexed :: !Bool
  - isPseudo :: !Bool
  - tokenKey :: !(CI ByteString)
  }
- tokenIx :: Token -> Int
- tokenCIKey :: Token -> ByteString
- tokenFoldedKey :: Token -> ByteString
- toToken :: ByteString -> Token
- minTokenIx :: Int
- maxStaticTokenIx :: Int
- maxTokenIx :: Int
- cookieTokenIx :: Int
- isMaxTokenIx :: Int -> Bool
- isCookieTokenIx :: Int -> Bool
- isStaticTokenIx :: Int -> Bool
- isStaticToken :: Token -> Bool
- tokenAuthority :: Token
- tokenMethod :: Token
- tokenPath :: Token
- tokenScheme :: Token
- tokenStatus :: Token
- tokenAcceptCharset :: Token
- tokenAcceptEncoding :: Token
- tokenAcceptLanguage :: Token
- tokenAcceptRanges :: Token
- tokenAccept :: Token
- tokenAccessControlAllowOrigin :: Token
- tokenAge :: Token
- tokenAllow :: Token
- tokenAuthorization :: Token
- tokenCacheControl :: Token
- tokenContentDisposition :: Token
- tokenContentEncoding :: Token
- tokenContentLanguage :: Token
- tokenContentLength :: Token
- tokenContentLocation :: Token
- tokenContentRange :: Token
- tokenContentType :: Token
- tokenCookie :: Token
- tokenDate :: Token
- tokenEtag :: Token
- tokenExpect :: Token
- tokenExpires :: Token
- tokenFrom :: Token
- tokenHost :: Token
- tokenIfMatch :: Token
- tokenIfModifiedSince :: Token
- tokenIfNoneMatch :: Token
- tokenIfRange :: Token
- tokenIfUnmodifiedSince :: Token
- tokenLastModified :: Token
- tokenLink :: Token
- tokenLocation :: Token
- tokenMaxForwards :: Token
- tokenProxyAuthenticate :: Token
- tokenProxyAuthorization :: Token
- tokenRange :: Token
- tokenReferer :: Token
- tokenRefresh :: Token
- tokenRetryAfter :: Token
- tokenServer :: Token
- tokenSetCookie :: Token
- tokenStrictTransportSecurity :: Token
- tokenTransferEncoding :: Token
- tokenUserAgent :: Token
- tokenVary :: Token
- tokenVia :: Token
- tokenWwwAuthenticate :: Token
- tokenConnection :: Token
- tokenTE :: Token
- tokenMax :: Token

# Data type

data Token

Internal representation for header keys.

Constructors

Token |
Fields ix :: !Int Index for value table shouldBeIndexed :: !Bool should be indexed in HPACK isPseudo :: !Bool is this a pseudo header key? tokenKey :: !(CI ByteString) Case insensitive header key

Instances

Eq Token |
Show Token |

tokenIx :: Token -> Int

Extracting an index from a token.

tokenCIKey :: Token -> ByteString

Extracting a case insensitive header key from a token.

tokenFoldedKey :: Token -> ByteString

Extracting a folded header key from a token.

toToken :: ByteString -> Token

Making a token from a header key.

    >>> toToken ":authority" == tokenAuthority
    True
    >>> toToken "foo"
    Token {ix = 54, shouldBeIndexed = True, isPseudo = False, tokenKey = "foo"}
    >>> toToken ":bar"
    Token {ix = 54, shouldBeIndexed = True, isPseudo = True, tokenKey = ":bar"}

# Ix

minTokenIx :: Int

Minimum token index.

maxStaticTokenIx :: Int

Maximun token index defined in the static table.

maxTokenIx :: Int

Maximum token index.

cookieTokenIx :: Int

Token index for `tokenCookie`.

# Utilities

isMaxTokenIx :: Int -> Bool

Is this token ix to be held in the place holder?

isCookieTokenIx :: Int -> Bool

Is this token ix for Cookie?

isStaticTokenIx :: Int -> Bool

Is this token ix for a header not defined in the static table?

isStaticToken :: Token -> Bool

Is this token for a header not defined in the static table?

# Defined tokens

tokenAuthority :: Token

tokenMethod :: Token

tokenPath :: Token

tokenScheme :: Token

tokenStatus :: Token

tokenAcceptCharset :: Token

tokenAcceptEncoding :: Token

tokenAcceptLanguage :: Token

tokenAcceptRanges :: Token

tokenAccept :: Token

tokenAccessControlAllowOrigin :: Token

tokenAge :: Token

tokenAllow :: Token

tokenAuthorization :: Token

tokenCacheControl :: Token

tokenContentDisposition :: Token

tokenContentEncoding :: Token

tokenContentLanguage :: Token

tokenContentLength :: Token

tokenContentLocation :: Token

tokenContentRange :: Token

tokenContentType :: Token

tokenCookie :: Token

tokenDate :: Token

tokenEtag :: Token

tokenExpect :: Token

tokenExpires :: Token

tokenFrom :: Token

tokenHost :: Token

tokenIfMatch :: Token

tokenIfModifiedSince :: Token

tokenIfNoneMatch :: Token

tokenIfRange :: Token

tokenIfUnmodifiedSince :: Token

tokenLastModified :: Token

tokenLink :: Token

tokenLocation :: Token

tokenMaxForwards :: Token

tokenProxyAuthenticate :: Token

tokenProxyAuthorization :: Token

tokenRange :: Token

tokenReferer :: Token

tokenRefresh :: Token

tokenRetryAfter :: Token

tokenServer :: Token

tokenSetCookie :: Token

tokenStrictTransportSecurity :: Token

tokenTransferEncoding :: Token

tokenUserAgent :: Token

tokenVary :: Token

tokenVia :: Token

tokenWwwAuthenticate :: Token

tokenConnection :: Token

Not defined in the static table.

tokenTE :: Token

Not defined in the static table.

tokenMax :: Token

A place holder to hold header keys not defined in the static table.