wasip3 HTTP guests enforce unresolved casing and URI normalization contracts

Open
#291 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
testing-qa

Research direction

Start with tests/rust/wasm32-wasip3/src/bin/http-fields.rs:309 and http-request.rs:156-157, then read the referenced WIT and WASI issues #780 and #787. The requested outcome depends on resolving those open contract questions; done means the guests match the resulting requirements, with optional empty-path accessor behavior tested separately from send-time behavior.

Written by the indexing model from the issue text.

Description

Summary

The Preview 3 http-fields and http-request guests enforce particular behaviors while the corresponding WASI contract questions remain open. Could these expectations be aligned with an explicitly identified contract revision?

Checked testsuite commits: pinned 609c446139956ff30239f87cb18af1dc6128bed2 and main 5f3c702bee1cde4362b018d1b3b1d99592af99e6 (the two Rust source files are identical). Reference WIT: WASI types.wit at 39c11a76.

Mixed header casing

http-fields.rs:309 appends foo: val1 and FOO: val2, then expects both names from copy_all to be foo.

A runtime retaining the input casing returns [("foo", b"val1"), ("FOO", b"val2")]. The WIT's fields and copy-all documentation calls for original casing, while https://github.com/WebAssembly/WASI/issues/787 discusses adapting subsequent names to existing casing. That issue is still open. This is not a disagreement about case-insensitive lookup: both spellings successfully retrieve the same values.

Empty path accessor

http-request.rs:156-157 sets Some("") and requires the getter to return Some("/").

The WIT does not explicitly require getter normalization. https://github.com/WebAssembly/WASI/issues/780 asks this exact question; the discussion proposes permitting rather than requiring normalization. A runtime can preserve Some("") in the resource while emitting / as the HTTP request target. This also differs from the send-time question in https://github.com/WebAssembly/WASI/issues/949.

Later URI assertions

The request guest subsequently accepts raw non-ASCII path characters and bare %, although its comment references RFC 3986. It also rejects an empty authority. These assertions deserve explicit URI/IRI and resource-vs-transport contract coverage rather than being inferred from one implementation's URI library. Separately, we found and are fixing our own authority setter's inappropriate rejection of valid userinfo and large numeric ports; we are not attributing every disagreement to this suite.

Evidence and requested resolution

Wasmoon Windows run 36679855167 preserves raw reports in the wasi03-windows-msvc artifact: both engines fail the two exact first assertions above. All four HTTP command guests reach execution. These raw failures remain failures; our regression gate acknowledges only their exact fingerprints and does not claim full conformance.

Please clarify which behaviors the suite intends to require and align these guests with the resolution of WASI #780/#787. In particular, if empty-path normalization is optional, the test should accept both permitted accessor results and test send-time behavior separately. For casing, please resolve the original-casing versus first-name-casing rule before using either as an unconditional conformance requirement.

Dominant language
Rust
Stars
88
Forks
50
Avg merge
8d 21h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WebAssembly/wasi-testsuite

All issues in WebAssembly/wasi-testsuite

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.