Skip to content

Commit 2da2a1c

Browse files
authored
Merge pull request #43 from WebAssembly/add-header-sharing-comment
Add comment regarding header/trailer sharing
2 parents eb04451 + b2b3ae0 commit 2da2a1c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

wit/types.wit

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ interface types {
6767

6868
// The following block defines the `incoming-request` and `outgoing-request`
6969
// resource types that correspond to HTTP standard Requests. Soon, when
70-
// resource types are added, the `u32` type aliases can be replaced by
71-
// proper `resource` type definitions containing all the functions as
72-
// methods. Later, Preview2 will allow both types to be merged together into
73-
// a single `request` type (that uses the single `stream` type mentioned
74-
// above). The `consume` and `write` methods may only be called once (and
75-
// return failure thereafter).
70+
// resource types are added, the `u32` type aliases can be replaced by proper
71+
// `resource` type definitions containing all the functions as methods.
72+
// Later, Preview2 will allow both types to be merged together into a single
73+
// `request` type (that uses the single `stream` type mentioned above). The
74+
// `consume` and `write` methods may only be called once (and return failure
75+
// thereafter). The `headers` and `trailers` passed into and out of requests
76+
// are shared with the request, with all mutations visible to all uses.
77+
// Components MUST avoid updating `headers` and `trailers` after passing a
78+
// request that points to them to the outside world.
7679
type incoming-request = u32
7780
type outgoing-request = u32
7881
drop-incoming-request: func(request: incoming-request)
@@ -128,6 +131,10 @@ interface types {
128131
// Preview2 will allow both types to be merged together into a single `response`
129132
// type (that uses the single `stream` type mentioned above). The `consume` and
130133
// `write` methods may only be called once (and return failure thereafter).
134+
// The `headers` and `trailers` passed into and out of responses are shared
135+
// with the response, with all mutations visible to all uses. Components MUST
136+
// avoid updating `headers` and `trailers` after passing a response that
137+
// points to them to the outside world.
131138
type incoming-response = u32
132139
type outgoing-response = u32
133140
drop-incoming-response: func(response: incoming-response)

0 commit comments

Comments
 (0)