diff --git a/proxy.md b/proxy.md
index 5a249a4..93edb93 100644
--- a/proxy.md
+++ b/proxy.md
@@ -817,11 +817,9 @@ http-related errors.
which have multiple values are represented by multiple entries in this
list with the same key.
The tuple is a pair of the field key, represented as a string, and
-Value, represented as a list of bytes. In a valid Fields, all keys
-and values are valid UTF-8 strings. However, values are not always
-well-formed, so they are represented as a raw list of bytes.
-An error result will be returned if any header or value was
-syntactically invalid, or if a header was forbidden.
+Value, represented as a list of bytes.
+An error result will be returned if any field-key
or field-value
is
+syntactically invalid, or if a field is forbidden.
Params
Get all of the values corresponding to a key. If the key is not present
-in this fields
, an empty list is returned. However, if the key is
-present but empty, this is represented by a list with one or more
-empty field-values present.
+in this fields
or is syntactically invalid, an empty list is returned.
+However, if the key is present but empty, this is represented by a list
+with one or more empty field-values present.
Params
self
: borrow<fields
>
@@ -860,6 +858,8 @@ syntactically invalid, false
is returned.
Set all of the values for a key. Clears any existing values for that
key, if they have been set.
Fails with header-error.immutable
if the fields
are immutable.
+Fails with header-error.invalid-syntax
if the field-key
or any of
+the field-value
s are syntactically invalid.
Params
self
: borrow<fields
>
@@ -874,6 +874,8 @@ key, if they have been set.
Delete all values for a key. Does nothing if no values for the key
exist.
Fails with header-error.immutable
if the fields
are immutable.
+Fails with header-error.invalid-syntax
if the field-key
is
+syntactically invalid.
Params
self
: borrow<fields
>
@@ -887,6 +889,8 @@ exist.
Append a value for a key. Does not change or delete any existing
values for that key.
Fails with header-error.immutable
if the fields
are immutable.
+Fails with header-error.invalid-syntax
if the field-key
or
+field-value
are syntactically invalid.
Params
self
: borrow<fields
>
diff --git a/wit/types.wit b/wit/types.wit
index 755ac6a..70cce55 100644
--- a/wit/types.wit
+++ b/wit/types.wit
@@ -159,20 +159,18 @@ interface types {
/// list with the same key.
///
/// The tuple is a pair of the field key, represented as a string, and
- /// Value, represented as a list of bytes. In a valid Fields, all keys
- /// and values are valid UTF-8 strings. However, values are not always
- /// well-formed, so they are represented as a raw list of bytes.
+ /// Value, represented as a list of bytes.
///
- /// An error result will be returned if any header or value was
- /// syntactically invalid, or if a header was forbidden.
+ /// An error result will be returned if any `field-key` or `field-value` is
+ /// syntactically invalid, or if a field is forbidden.
from-list: static func(
entries: list>
) -> result;
/// Get all of the values corresponding to a key. If the key is not present
- /// in this `fields`, an empty list is returned. However, if the key is
- /// present but empty, this is represented by a list with one or more
- /// empty field-values present.
+ /// in this `fields` or is syntactically invalid, an empty list is returned.
+ /// However, if the key is present but empty, this is represented by a list
+ /// with one or more empty field-values present.
get: func(name: field-key) -> list;
/// Returns `true` when the key is present in this `fields`. If the key is
@@ -183,18 +181,27 @@ interface types {
/// key, if they have been set.
///
/// Fails with `header-error.immutable` if the `fields` are immutable.
+ ///
+ /// Fails with `header-error.invalid-syntax` if the `field-key` or any of
+ /// the `field-value`s are syntactically invalid.
set: func(name: field-key, value: list) -> result<_, header-error>;
/// Delete all values for a key. Does nothing if no values for the key
/// exist.
///
/// Fails with `header-error.immutable` if the `fields` are immutable.
+ ///
+ /// Fails with `header-error.invalid-syntax` if the `field-key` is
+ /// syntactically invalid.
delete: func(name: field-key) -> result<_, header-error>;
/// Append a value for a key. Does not change or delete any existing
/// values for that key.
///
/// Fails with `header-error.immutable` if the `fields` are immutable.
+ ///
+ /// Fails with `header-error.invalid-syntax` if the `field-key` or
+ /// `field-value` are syntactically invalid.
append: func(name: field-key, value: field-value) -> result<_, header-error>;
/// Retrieve the full set of keys and values in the Fields. Like the