You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
changed the title [-]Can it be assumed that field keys have whitespace trimmed?[/-][+]Can it be assumed that fields have whitespace trimmed?[/+]on Aug 2, 2024
Good point, I think we do need to tighten this up in the prose wording. I think the appropriate rule is that any field-key parameter (which we need to rename to field-name: WebAssembly/wasi-http#107) in wasi-http needs to be validated to match the field-name grammar in RFC 9110 (which ends up disallowing whitespace, to your point) and, similarly, any field-value parameter in wasi-http must match the field-value grammar in RFC 9110 (which ends up requiring the trimming), with a failure to match returning invalid-syntax.
Activity
[-]Can it be assumed that field keys have whitespace trimmed?[/-][+]Can it be assumed that fields have whitespace trimmed?[/+][-]Can it be assumed that fields have whitespace trimmed?[/-][+]Header Validations[/+]guybedford commentedon Aug 2, 2024
I've updated the description here to separately consider keys and values.
lukewagner commentedon Aug 12, 2024
Good point, I think we do need to tighten this up in the prose wording. I think the appropriate rule is that any
field-keyparameter (which we need to rename tofield-name: WebAssembly/wasi-http#107) in wasi-http needs to be validated to match thefield-namegrammar in RFC 9110 (which ends up disallowing whitespace, to your point) and, similarly, anyfield-valueparameter in wasi-http must match thefield-valuegrammar in RFC 9110 (which ends up requiring the trimming), with a failure to match returninginvalid-syntax.