Skip to content

[tracking] typed headers #99

Open
Open
@yoshuawuyts

Description

@yoshuawuyts

This is a tracking issue for typed headers. I looked over the
HTTP headers page and categorized which headers would need to be ported.

There are probably some nuances in how we want to implement them, but this provides an overview of how far along we are in constructing typed constructors for all header types.

edit: I realize now that this might read a bit dated. I drafted this text back in December but forgot to post it. Some things may seem a bit outdated or different; the most important part is that we can track whether we can construct headers .

Authentication (auth)

  • WWW-Authenticate (auth::Authenticate)
  • Authorization (auth::Authorization)
  • Proxy-Authenticate (auth::ProxyAuthenticate)
  • Proxy-Authorization (auth::ProxyAuthorization)

Caching (cache)

  • Age (cache::Age)
  • Cache-Control (cache::Control)
  • Clear-Site-Data (cache::ClearSite)
  • Expires (cache::Expires)
  • Pragma (cache::Pragma) (HTTP/1.0 only)
  • Warning (cache::Warning) (soon to be deprecated)

Client Hints (client_hints)

  • Accept-CH (ch::Accept) (experimental, implementation postponed)
  • Accept-CH-Lifetime (ch::Lifetime) (experimental, implementation postponed)
  • Early-Data (ch::EarlyData) (experimental, implementation postponed)
  • Content-DPR (ch::ContentDpr) (experimental, implementation postponed)
  • DPR (ch::Dpr) (experimental, implementation postponed)
  • Device-Memory (ch::DeviceMemory) (experimental, implementation postponed)
  • Save-Data (ch::SaveData) (experimental, implementation postponed)
  • Viewport-Width (ch::ViewportWidth) (experimental, implementation postponed)
  • Width (ch::Width) (experimental, implementation postponed)

Conditionals (conditionals)

  • Last-Modified (conditionals::LastModified)
  • Etag (conditionals::Etag)
  • If-Match (conditionals::IfMatch)
  • If-Modified-Since (conditionals::IfModifiedSince)
  • If-Unmodified-Since (conditionals::IfUnmodifiedSince)
  • Vary (conditionals::Vary)

Content Negotiation (content)

  • Accept (content::Accept)
  • Accept-Charset (content::Charset) (no longer supported by any browser)
  • Accept-Encoding (content::Encoding)
  • Accept-Language (content::Language)

Controls (controls)

  • Expect (controls::Expect)

Cookies

I think this one is special, and we should re-export the
cookie crate, and just expose get /
set cookies as methods on the Request and Response types. Let's just treat
them as built-ins to evade the name collision.

CORS (cors)

  • Access-Control-Allow-Origin (cors::AllowOrigin)
  • Access-Control-Allow-Credentials (cors::AllowCredentials)
  • Access-Control-Allow-Headers (cors::AllowHeaders)
  • Access-Control-Allow-Methods (cors::AllowMethods)
  • Access-Control-Expose-Headers (cors::ExposeHeaders)
  • Access-Control-Max-Age (cors::MaxAge)
  • Access-Control-Request-Headers (cors::RequestHeaders)
  • Access-Control-Request-Method (cors::RequestMethod)
  • Access-Control-Origin (cors::Origin)
  • Access-Control-Timing-Allow-Origin (cors::TimingAllowOrigin)

Do Not Track (privacy)

  • DNT (privacy::DoNotTrack)
  • Tk (privacy::TrackingStatus)

Content Information (content)

  • Content-Disposition (downloads::Disposition)
  • Content-Length (content::Length)
  • Content-Type (content::Type)
  • Content-Encoding (content::Encoding)
  • Content-Language (content::Language)
  • Content-Location (content::Location)

Proxies (proxies)

  • Forwarded (proxies::Forwarded)
  • Via (proxies::Via)

Response (response)

  • Allow (response::Allow)

Range (content)

  • Accept-Ranges (range::Accept)
  • Range (range::Range)
  • If-Range (range::If)
  • Content-Range (range::Content)

Security (security)

  • Cross-Origin-Opener-Policy (security::Coop)
  • Cross-Origin-Resource-Policy (security::Cors)
  • Content-Security-Policy (security::Csp)
  • Content-Security-Policy-Report-Only (security::Cspro)
  • Expect-CT (security::Cspro)
  • Feature-Policy (security::FeaturePolicy)
  • Public-Key-Pins (security::HPKP) (deprecated)

Other

  • Alt-Svc
  • Date
  • Large-Allocation (unspecced; firefox only)
  • Link
  • Referer
  • Retry-After
  • SourceMap
  • Upgrade
  • User-Agent
  • Keep-Alive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions