Skip to content

Commit 2675aa0

Browse files
committed
feat(http): size-exceeded error variant
Opting for documenting two floors, one for individual fields and the other for aggregate. Exceeding either will fail with `header-error.size-exceeded`. Resolves #889
1 parent 2bf9c47 commit 2675aa0

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

proposals/cli/wit-0.3.0-draft/deps.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sha512 = "f08a2828b88fc6ddea935af584531c484ad4a7a5f30340265e11e91b2bfe0f81e74a66
55

66
[filesystem]
77
path = "../../filesystem/wit-0.3.0-draft"
8-
sha256 = "184861e98785957311bfaab242cdf9e66a9ecca11fe2c493b840c461b2361088"
9-
sha512 = "50fa8801fc0a2c1ecfa3cea52af57836f98a12bb0a264439c13bbdcc0e269b3b37ade38b903d6ce10594d1f585d02ef993f3f769c4cddeebdfc00bf93734ed25"
8+
sha256 = "8808ea3adfbc1a025d649b82ddf4f38232ca4377100cfe671d80d5ee37fa3147"
9+
sha512 = "19f4eb8fa62e96ba37b3ea231af6a3bc396c28f82935018a3322441321936b34fb0e44360b378145fcb681d9fea810745969d8baab02ae6017be1784be8abe45"
1010

1111
[random]
1212
path = "../../random/wit-0.3.0-draft"
@@ -15,5 +15,5 @@ sha512 = "812ce57aa13ff3128779d41f4dad50714365e4f9cfd2e1b13458a885fa65da05e409f1
1515

1616
[sockets]
1717
path = "../../sockets/wit-0.3.0-draft"
18-
sha256 = "985821e86f2643d90b7a100420a44a5a60a6838adcf76fdb90a66255e3926dde"
19-
sha512 = "9ba1e9456c0dc02800ba738acd382a4113103bed72127396546c5f0ad3d38dd5c8e077443bd508b15f86f6095706907e9cb258cccab37c273b4c597a238987e7"
18+
sha256 = "0be70fab90ec1d62e620f37f8fc55397222ceb68ca8387eb0503df7173782634"
19+
sha512 = "997e336258dd3d8d1bf1b27463e77d1dc2160eb13fff899c93b446973f5efbc59448a23279b60568679c08e006a20cc88769ec74d6d30baa4e7a17df0bdb2c30"

proposals/http/wit-0.3.0-draft/deps.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ sha256 = "888647625fec3eaaf276cb884e426bc32bfa79ced22955f10eb239df74c8550c"
1010
sha512 = "f08a2828b88fc6ddea935af584531c484ad4a7a5f30340265e11e91b2bfe0f81e74a660a512f72e5197d60278feccc00534833ebd73868e801859dd31a61bdbb"
1111

1212
[filesystem]
13-
sha256 = "184861e98785957311bfaab242cdf9e66a9ecca11fe2c493b840c461b2361088"
14-
sha512 = "50fa8801fc0a2c1ecfa3cea52af57836f98a12bb0a264439c13bbdcc0e269b3b37ade38b903d6ce10594d1f585d02ef993f3f769c4cddeebdfc00bf93734ed25"
13+
sha256 = "8808ea3adfbc1a025d649b82ddf4f38232ca4377100cfe671d80d5ee37fa3147"
14+
sha512 = "19f4eb8fa62e96ba37b3ea231af6a3bc396c28f82935018a3322441321936b34fb0e44360b378145fcb681d9fea810745969d8baab02ae6017be1784be8abe45"
1515

1616
[random]
1717
sha256 = "5794796c909d6656fcbae6bed28265210ca57308a624119ac0a472326a75aa8f"
1818
sha512 = "812ce57aa13ff3128779d41f4dad50714365e4f9cfd2e1b13458a885fa65da05e409f145deefa25c4a82e0e301a41e2e6572705b35752dc33908d565a73a2e9c"
1919

2020
[sockets]
21-
sha256 = "985821e86f2643d90b7a100420a44a5a60a6838adcf76fdb90a66255e3926dde"
22-
sha512 = "9ba1e9456c0dc02800ba738acd382a4113103bed72127396546c5f0ad3d38dd5c8e077443bd508b15f86f6095706907e9cb258cccab37c273b4c597a238987e7"
21+
sha256 = "0be70fab90ec1d62e620f37f8fc55397222ceb68ca8387eb0503df7173782634"
22+
sha512 = "997e336258dd3d8d1bf1b27463e77d1dc2160eb13fff899c93b446973f5efbc59448a23279b60568679c08e006a20cc88769ec74d6d30baa4e7a17df0bdb2c30"

proposals/http/wit-0.3.0-draft/types.wit

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ interface types {
116116
/// This error indicates that the operation on the `fields` was not
117117
/// permitted because the fields are immutable.
118118
immutable,
119+
120+
/// This error indicates that the operation would exceed an
121+
/// implementation-defined limit on field sizes. This may apply to
122+
/// an individual `field-value`, a single `field-name` plus all its
123+
/// values, or the total aggregate size of all fields.
124+
///
125+
/// Implementations MUST accept individual field values of at least
126+
/// 8192 bytes and total aggregate field sections of at least 16384
127+
/// bytes. These minimums ensure portability across common HTTP
128+
/// servers and match HTTP/2's minimum SETTINGS_MAX_FRAME_SIZE.
129+
size-exceeded,
119130
}
120131

121132
/// This type enumerates the different kinds of errors that may occur when
@@ -158,6 +169,12 @@ interface types {
158169
/// original casing used to construct or mutate the `fields` resource. The `fields`
159170
/// resource should use that original casing when serializing the fields for
160171
/// transport or when returning them from a method.
172+
///
173+
/// Implementations may impose limits on individual field values and on total
174+
/// aggregate field section size. Operations that would exceed these limits
175+
/// fail with `header-error.size-exceeded`. Implementations MUST accept
176+
/// individual field values of at least 8192 bytes and total aggregate field
177+
/// sections of at least 16384 bytes.
161178
@since(version = 0.3.0-rc-2026-02-09)
162179
resource fields {
163180

@@ -180,7 +197,8 @@ interface types {
180197
/// well-formed, so they are represented as a raw list of bytes.
181198
///
182199
/// An error result will be returned if any header or value was
183-
/// syntactically invalid, or if a header was forbidden.
200+
/// syntactically invalid, if a header was forbidden, or if the
201+
/// entries would exceed an implementation size limit.
184202
from-list: static func(
185203
entries: list<tuple<field-name,field-value>>
186204
) -> result<fields, header-error>;
@@ -199,6 +217,9 @@ interface types {
199217
/// name, if they have been set.
200218
///
201219
/// Fails with `header-error.immutable` if the `fields` are immutable.
220+
///
221+
/// Fails with `header-error.size-exceeded` if the name or values would
222+
/// exceed an implementation-defined size limit.
202223
set: func(name: field-name, value: list<field-value>) -> result<_, header-error>;
203224

204225
/// Delete all values for a name. Does nothing if no values for the name
@@ -219,6 +240,9 @@ interface types {
219240
/// values for that name.
220241
///
221242
/// Fails with `header-error.immutable` if the `fields` are immutable.
243+
///
244+
/// Fails with `header-error.size-exceeded` if the value would exceed
245+
/// an implementation-defined size limit.
222246
append: func(name: field-name, value: field-value) -> result<_, header-error>;
223247

224248
/// Retrieve the full set of names and values in the Fields. Like the

0 commit comments

Comments
 (0)