spinframework / spinframework/spin
rust sdk: Inbound http inconsistency with `wasmtime serve`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
From https://github.com/fermyon/http-auth-middleware/pull/4#issue-1973344440
I believe this is due to the Rust SDK's conditional reconstruction of the full URI:
If scheme and/or authority is missing, this will return just the path.
While technically a URI must have a scheme and authority, it appears that http::Request::uri (amongst others) produces just a path for inbound requests on many servers.
For compatibility reasons I think we should align with that for inbound wasi-http, though it will be annoying to adjust the conversions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sdk/rust/src/http.rs at lines 450-464 and review the linked http-auth-middleware report. Trace the inbound wasi-http URI conversion and its related conversions to determine how requests lacking a scheme or authority are represented. Done means inbound behavior is compatible with the expected path-only form without breaking full URIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100