Stream: git-wasmtime

Topic: wasmtime / PR #7524 wasi-http: Make child fields immutable


view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:18):

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 the fields value has failed because that fields is immutable. All fields returned by getter methods on any of the request/response types are considered immutable, while fields that have been created directly through the use of the fields 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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:18):

elliottt requested wasmtime-core-reviewers for a review on PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:18):

elliottt requested fitzgen for a review on PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:18):

elliottt requested pchickey for a review on PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:26):

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 turn get_fields_mut which returns Result<&mut FieldMap, HeaderError> that will only be used for set/append/delete and itself return Err(HeaderError::Immutable)?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:37):

elliottt updated PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:38):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:42):

elliottt updated PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:46):

elliottt updated PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 18:51):

elliottt has enabled auto merge for PR #7524.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2023 at 19:53):

elliottt merged PR #7524.


Last updated: Dec 23 2024 at 12:05 UTC