WebAssembly / WebAssembly/WASI

[http] deprecate `request-options` `first-byte-timeout`

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

Nobody has claimed this yet.

P-http proposal
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

I think we should deprecate first-byte-timeout:

  • For many HTTP clients (including fetch), the first (non-error) event observable after dispatching a request is the end of response headers (e.g. \r\n\r\n for HTTP/1.1). The first-byte-timeout instead wants to wait for one more byte: "the first byte of the Response body". I'm not familiar with any reason to treat that byte as special.

  • End of response headers already has an event: the async return of response. If someone wants a timeout there they can use a regular timer that races the response.

  • The timeout between end of response headers and the first byte of the response body can instead be covered by between-bytes-timeout. This would technically be a breaking change but I believe wasmtime-wasi-http and jco already behave this way, so I suggest that we just document that both the original spec behavior and the current implementations' behaviors are acceptable.

Contributor guide

Open the contributing guide

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.

Research direction

Start with proposals/http/wit/types.wit at the request-options definitions, then compare the referenced behavior in crates/wasi-http/src/default_send_request.rs and packages/preview2-shim/src/browser/http.ts. Confirm the intended compatibility wording and update the specification so the deprecation and acceptable timeout behavior are documented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript, wasm
Domain
api, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.