Repository navigation
feat(wasm): add Response extensions and version accessors - #3145
Open
CharoenwitKunna wants to merge 5 commits into
Open
CharoenwitKunna wants to merge 5 commits into
CharoenwitKunna wants to merge 5 commits into
Conversation
CharoenwitKunna
force-pushed
the
wasm-response-extensions-2835
branch
from
November 25, 2026 05:10
07e6f1e to
11ea959
Compare
Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
The WASM
Responsetype now exposesextensions(),extensions_mut()andversion(), delegating to the innerhttp::Response, matching the nativeResponseAPI. Theversion()method existed but was commented out behind a note questioning whether the version is detectable in JS.Why
Issue #2835. The owner confirmed missing WASM methods are usually simply ones nobody has needed yet and invited a PR. In a browser build the underlying
http::Responseis created by a builder without a wire version, soversion()reportsHTTP/1.1(the same as native's default) ? this is API parity, not wire-version detection.Scope
From<http::Response>is intentionally not included here: native fabricates a URL and builds anAbortGuard, neither of which has a clean WASM equivalent. Left for a separate design decision.Verification
#[cfg(target_arch = "wasm32")]); non-wasm builds are unaffected.#![deny(missing_docs)], so these comments are required for the public methods to compile.wasm_bindgen_testintests/wasm_simple.rsexercises version/extensions. WASM tests run in CI; not run locally.Fixes #2835