WASI icon indicating copy to clipboard operation
WASI copied to clipboard

Header Validations

Open guybedford opened this issue 1 year ago • 2 comments

Some questions with regards to header validations:

  • Valid headers keys must not include whitespace
  • Valid header values must have whitespace trimmed

Possible clarifications that therefore might be made:

Keys

  • Could clarify that they are always valid according to eg https://searchfox.org/mozilla-central/rev/9f76a47f4aa935b49754c5608a1c8e72ee358c46/netwerk/protocol/http/nsHttp.cpp#172-215 (which includes disallowing whitespace)

Values

  • Could clarify that they are always trimmed by \t, , \r\ and \n
  • Could clarify that they contain no inner \0, \r or \n.

Without the above assumptions, returning values to the user risks returning invalid values from a get() or entries() call, making any fetch-based Headers implementation on top of these primitives non-standard.

guybedford avatar Jul 31 '24 16:07 guybedford