Skip to content

Structured Header Mappings

Mark Nottingham edited this page Nov 23, 2018 · 7 revisions

This is a mapping of existing common (not all) HTTP headers into the closest Structured Headers, along with notes about potential issues, mismatches, etc.

Just because a header value fits into a structured header type syntactically, doesn't mean SH can be used for it; for example, error handling is probably different between SH and existing implementations.

Parameterised Lists

  • Accept
  • Accept-Encoding
  • Accept-Language
  • Alt-Svc
  • Content-Type - single value; parameterised item?
  • Forwarded
  • TE

Dicts

  • Cache-Control
  • Pragma
  • Surrogate-Control
  • Prefer
  • Preference-Applied
  • Digest - dict of identifiers, digest values

Integers

  • Age
  • Content-Length
  • Access-Control-Max-Age

Identifiers

See this issue

  • Alt-Used: identifier - uses :
  • Host - hostname
  • Content-Encoding - token
  • Expect - token
  • Origin - hostname
  • Access-Control-Allow-Credentials
  • Access-Control-Request-Method - method
  • X-Content-Type-Options
  • Access-Control-Allow-Origin - uses :

Lists of identifiers

  • Accept-Patch
  • Accept-Ranges
  • Allow
  • ALPN - percent-encoded
  • Content-Language
  • Transfer-Encoding
  • Vary
  • Trailer
  • Access-Control-Allow-Headers - field-name
  • Access-Control-Allow-Methods - method
  • Access-Control-Request-Headers - field-name

Don't work with SH as-is

A viable strategy might be to define a H2 SETTING (etc) that creates a mapping between new headers and "old" ones; e.g., Cookie -> SH-Cookie.

URLs

Serialise as string

  • Content-Location
  • Location
  • Referer

Dates

Serialise as integer? See this issue

  • Date
  • Expires
  • If-Modified-Since
  • If-Unmodified-Since
  • Last-Modified

Other

  • Early-Data - integer or boolean
  • Retry-After - integer / Date
  • Cookie: NO (semicolon-separated)
  • Set-Cookie: NO (semicolon-separated)
  • Strict-Transport-Security: NO (semicolon-separated)
  • Authorization: NO
  • WWW-Authenticate: NO
  • Content-Disposition: NO (i18n)
  • Content-Range: NO (range structure)
  • Range: NO (range structure)
  • ETag: NO (weak flag)
  • If-None-Match: NO (weak flag)
  • If-Match: NO (alternate forms, weak flag)
  • If-Range: NO (alternate forms)
  • Link: NO (link structure)
  • Via: NO (product/comment)
  • Server: NO (product/comment)
  • User-Agent: NO (product/comment)

Clone this wiki locally