elliottt opened PR #7524 from elliottt:trevor/immutable-fields to bytecodealliance:main:
This PR adds a new case to the
header-errorvariant,immutable, which indicates that an operation that would modify thefieldsvalue has failed because thatfieldsis immutable. Allfieldsreturned by getter methods on any of the request/response types are considered immutable, whilefieldsthat have been created directly through the use of thefieldsconstructor are considered mutable until ownership is passed to an outgoing request or response.This change paves the way to runtime validation of the
Content-Lengthheader, ensuring that it's safe to check the value provided when an outgoing request or response is created.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
elliottt requested wasmtime-core-reviewers for a review on PR #7524.
elliottt requested fitzgen for a review on PR #7524.
elliottt requested pchickey for a review on PR #7524.
pchickey submitted PR review:
Instead of checking the immutability flag in the callee, can we factor it into a
get_fieldsthat returns a&FieldMapand use that in all the cases that don't require mutability, and then turnget_fields_mutwhich returnsResult<&mut FieldMap, HeaderError>that will only be used for set/append/delete and itself returnErr(HeaderError::Immutable)?
elliottt updated PR #7524.
pchickey submitted PR review.
elliottt updated PR #7524.
elliottt updated PR #7524.
elliottt has enabled auto merge for PR #7524.
elliottt merged PR #7524.
Last updated: Dec 13 2025 at 19:03 UTC