Stream: git-wasmtime

Topic: wasmtime / PR #13471 Add request headers to wasmtime serve


view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 11:41):

angelnereira opened PR #13471 from angelnereira:serve-cli-headers to bytecodealliance:main:

Summary

Fixes #11925.

This adds -H, --header to wasmtime serve so requests can be forwarded to the component with CLI-provided headers. This is useful when testing components that normally run behind a proxy or gateway that injects authentication, identity, routing, or other request metadata.

Behavior:

Testing

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 11:42):

angelnereira requested pchickey for a review on PR #13471.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 11:42):

angelnereira requested wasmtime-core-reviewers for a review on PR #13471.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:20):

:memo: alexcrichton submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:20):

:speech_balloon: alexcrichton created PR review comment:

s/header/value/ in the error message perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:20):

:speech_balloon: alexcrichton created PR review comment:

Out of curiosity, how come this removes everything, then appends everything? I'd naively expect that remove-then-append for each key individually would work?

If it's for some specific behavior, could a test be added for that?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:20):

:speech_balloon: alexcrichton created PR review comment:

s/header/name/ in the error message perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:20):

:speech_balloon: alexcrichton created PR review comment:

Could you add a test for the file-reading behavior as well?

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 15:47):

angelnereira commented on PR #13471:

Thanks for the review. I’ll update the two error messages, add coverage for @file header loading, and add a test/comment for the two-phase remove/append behavior to preserve repeated CLI-provided header values.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 16:44):

angelnereira updated PR #13471.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 17:03):

angelnereira updated PR #13471.

view this post on Zulip Wasmtime GitHub notifications bot (May 24 2026 at 17:33):

angelnereira commented on PR #13471:

Update pushed.

I kept the two-phase remove/append behavior intentionally: first remove all request-provided values for any CLI-specified header
name, then append all CLI-provided values in CLI order. This preserves repeated CLI-provided values for the same header name, which
would be lost if we removed and appended one entry at a time.

I added coverage for that repeated-header case, added coverage for --header=@file, and updated the error messages to distinguish
invalid header names from invalid header values.

view this post on Zulip Wasmtime GitHub notifications bot (May 25 2026 at 14:33):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 25 2026 at 14:33):

alexcrichton added PR #13471 Add request headers to wasmtime serve to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 25 2026 at 14:58):

:check: alexcrichton merged PR #13471.

view this post on Zulip Wasmtime GitHub notifications bot (May 25 2026 at 14:58):

alexcrichton removed PR #13471 Add request headers to wasmtime serve from the merge queue.


Last updated: Jun 01 2026 at 09:49 UTC