elliottt opened PR #7524 from elliottt:trevor/immutable-fields
to bytecodealliance:main
:
This PR adds a new case to the
header-error
variant,immutable
, which indicates that an operation that would modify thefields
value has failed because thatfields
is immutable. Allfields
returned by getter methods on any of the request/response types are considered immutable, whilefields
that have been created directly through the use of thefields
constructor are considered mutable until ownership is passed to an outgoing request or response.This change paves the way to runtime validation of the
Content-Length
header, 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_fields
that returns a&FieldMap
and use that in all the cases that don't require mutability, and then turnget_fields_mut
which 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 23 2024 at 12:05 UTC