Commit e98a4d4
committed
feat(cli): p3 WasiHttpHooks route through ActHttpClient (full reqwest)
Wires the p3 hook to ActHttpClient::send_p3 and drops wasmtime-
wasi-http's default-send-request feature entirely. Both p2 and p3
now go through reqwest — no fallback.
Root cause of the earlier p3 trap: response bodies were wrapped in
http_body_util::StreamBody, which never overrides is_end_stream()
(always returns false). wasi-fetch guests traps when reading HTTP/2
responses because they rely on is_end_stream() to detect body
completion. HTTP/1.1 responses worked because the transfer-encoding
framing gives the guest another signal.
Fix: use reqwest::Body::from(response) as the response body source —
reqwest::Body delegates is_end_stream() to its hyper inner body,
matching what wasmtime-wasi-http's default IncomingResponseBody does.
Map errors with BodyExt::map_err, box as UnsyncBoxBody.
Also: strip transfer-encoding / content-length from forwarded
response headers — reqwest/hyper already consumed transport framing,
propagating the original hints can confuse the guest when bytes
re-frame through our pipeline.
wasmtime-wasi-http dep now uses default-features = false with
explicit [p2, p3] — drops the tokio-rustls / rustls /
webpki-roots transitive bundle from default-send-request.1 parent f752e16 commit e98a4d4
4 files changed
Lines changed: 24 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
302 | 304 | | |
303 | | - | |
| 305 | + | |
304 | 306 | | |
305 | | - | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
0 commit comments