wasi-http icon indicating copy to clipboard operation
wasi-http copied to clipboard

[v0.3] Request metadata

Open lann opened this issue 1 year ago • 7 comments

Original context: https://github.com/WebAssembly/wasi-http/pull/3#discussion_r1122091615

There are certain pieces of metadata that are commonly associated with requests but aren't part of HTTP itself, e.g.:

  • Peer IP address
  • TLS session details (certificates, ciphers, etc)
  • HTTP URL router match results (original pattern, parameters, etc)

This kind of metadata can be inserted into requests as headers, but this has historically been a source of security and name collision issues and I hope we can offer a better alternative.

A few options to consider:

  • Add methods for the most common bits of metadata directly to the request type
  • Add a generic "metadata"/"extensions" map to the request type (like hyper)
  • Add a separate "metadata"/"context" argument to handle

lann avatar Mar 02 '23 21:03 lann