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
{{ message }}
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
Perhaps be more specific about casing of field-keys #117
For example, fields#get likely should return values no matter the casing of the field-key passed in. This is how wasmtime's implementation currently works, but it doesn't seem specified anywhere that this must be the case. What's more, in wasmtime fields#entries returns tuples of the field-key/field-value pair where the field-key has the original casing. Is this the correct behavior or should hosts perhaps be expected to canonicalize these fields to lowercase instead?
Yes, good point, we need to improve the specified behavior here. I'd suggest the following:
Specify that field-name equality (as used by fields.get, fields.set, etc) is case insensitive (as defined by RFC 9110)
The fields resource remembers the original case of field names (exactly as passed to set or as came in over the wire), and this remembered-case is what goes out over the wire. This is what the JS Fetch API specifies because it was found necessary in practice for various interop scenarios.
Unlike with the JS Fetch API's Headers.get(), which returns always-lowered, and Headers.entries(), which returns always-sorted, specify that WASI HTTP's fields.get and fields.entries returns the original case in the over-the-wire order so that it's possible for content to know exactly what will go out over the wire.
Activity
pchickey commentedon Jun 26, 2024
Good point. @guybedford what does node do for this behavior?
guybedford commentedon Jun 26, 2024
Node.js automatically lowercases all header keys by the time they are provided to the user.
lukewagner commentedon Jun 28, 2024
Yes, good point, we need to improve the specified behavior here. I'd suggest the following:
fields.get,fields.set, etc) is case insensitive (as defined by RFC 9110)fieldsresource remembers the original case of field names (exactly as passed tosetor as came in over the wire), and this remembered-case is what goes out over the wire. This is what the JS Fetch API specifies because it was found necessary in practice for various interop scenarios.Headers.get(), which returns always-lowered, andHeaders.entries(), which returns always-sorted, specify that WASI HTTP'sfields.getandfields.entriesreturns the original case in the over-the-wire order so that it's possible for content to know exactly what will go out over the wire.