@@ -67,12 +67,15 @@ interface types {
67
67
68
68
// The following block defines the `incoming-request` and `outgoing-request`
69
69
// 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.
76
79
type incoming-request = u32
77
80
type outgoing-request = u32
78
81
drop-incoming-request : func (request : incoming-request )
@@ -128,6 +131,10 @@ interface types {
128
131
// Preview2 will allow both types to be merged together into a single `response`
129
132
// type (that uses the single `stream` type mentioned above). The `consume` and
130
133
// `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.
131
138
type incoming-response = u32
132
139
type outgoing-response = u32
133
140
drop-incoming-response : func (response : incoming-response )
0 commit comments