xia-chao opened PR #14702 from xia-chao:fix/wasi-http-field-map-capacity-error to bytecodealliance:main:
A full HeaderMap made Fields::set/delete report invalid-syntax for valid names. http's try_entry was treating MaxSizeReached as InvalidHeaderName. This PR switches to try_insert/try_append.
xia-chao requested rvolosatovs for a review on PR #14702.
xia-chao requested wasmtime-wasi-reviewers for a review on PR #14702.
:repeat: rvolosatovs submitted PR review.
:speech_balloon: rvolosatovs created PR review comment:
try_appendcould fail here, which could leave the map in inconsistent state and incorrectly report size
:speech_balloon: rvolosatovs created PR review comment:
could we make this smaller?
:speech_balloon: rvolosatovs created PR review comment:
this seems to be testing implementation details of
httpcrate, instead, let's assert the actual results we expect (e.g. error with TooManyFields)I'd suggest breaking each statement line-by-line and asserting result of each operation individually without using an array
:speech_balloon: rvolosatovs created PR review comment:
The
keywas already parsed here, so could we keep using the entry API if we did something like:map.try_entry(key).map_err(|_| FieldMapError::TooManyFields)?
:memo: rvolosatovs submitted PR review.
:speech_balloon: rvolosatovs created PR review comment:
// `try_entry` misreports a full map as `InvalidHeaderName`.
:speech_balloon: rvolosatovs deleted PR review comment.
:speech_balloon: rvolosatovs edited PR review comment.
xia-chao updated PR #14702.
xia-chao commented on PR #14702:
Done! Thanks!
:thumbs_up: rvolosatovs submitted PR review:
Thanks!
There's still a little issue with
setsetting keys that already exist, but this is already an improvement and it fixes an existing issue, so I'm going to merge this.Would you like to work on a follow-up for
setspecifically?
:speech_balloon: rvolosatovs created PR review comment:
this actually looks wrong, because
setshould have replaced the values
:speech_balloon: rvolosatovs created PR review comment:
Unfortunately, this would still prevent
setfor a key, which already exists when the map is full, even though the values should have been replaced.Perhaps we could work around that by first removing the key?
rvolosatovs added PR #14702 wasi-http: report a full field map as size-exceeded to the merge queue.
rvolosatovs removed PR #14702 wasi-http: report a full field map as size-exceeded from the merge queue.
:check: rvolosatovs merged PR #14702.
Last updated: Oct 31 2026 at 23:03 UTC