Skip to content

fix(webtransport): avoid url parse panic - #36066

Merged
bartlomieju merged 1 commit into
denoland:mainfrom
nathanwhit:fix/webtransport-url-conversion
Jul 16, 2026
Merged

bartlomieju merged 1 commit into
denoland:mainfrom
nathanwhit:fix/webtransport-url-conversion

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

Summary

  • serialize parsed WebTransport URLs with the captured URL prototype method
  • return a typed error if the native URL conversion receives an invalid value
  • add a regression covering an overridden URL.prototype.toString

Bug

The WebTransport constructor parses its URL up front, but the connection path later serialized that object through mutable prototype dispatch. An override could replace the serialized value with an invalid string, while the native connection op assumed parsing was infallible and unwrapped the result. Using the captured method preserves the parsed URL, and the native boundary now handles conversion failure without a process panic.

Validation

  • ./tools/format.js
  • cargo fmt --check --package deno_net
  • cargo check -p deno_net
  • cargo build --bin deno
  • cargo test -p specs_tests --test specs run::webtransport -- --nocapture

@nathanwhit
nathanwhit marked this pull request as ready for review July 15, 2026 20:47
@bartlomieju
bartlomieju merged commit 7fcf79c into denoland:main Jul 16, 2026
172 checks passed
bartlomieju pushed a commit that referenced this pull request Jul 23, 2026
- serialize parsed WebTransport URLs with the captured URL prototype
method
- return a typed error if the native URL conversion receives an invalid
value
- add a regression covering an overridden `URL.prototype.toString`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants