Skip to content

WASIp3 request#set-scheme is more lenient than RFC 9110 #11778

Open

Description

@wingo

RFC 3986 §3.1, referred to by RFC 9110, specifies that URI schemes should begin with an ascii alphabetic character and then continue the same but also allowing +, -, numbers and .:

      scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

And in Wasmtime, we have the expected behavior in that request.set_method allows the productions above and rejects most others, but it is more lenient in that it allows schemes that begin with a character in +-.0123456789~. Probably that needs tightening up.

Activity

  1. added
    bugIncorrect behavior in the current implementation that needs fixing
    on Oct 2, 2025
  2. wingo commented on Oct 2, 2025

    @wingo
    ContributorAuthor

    We should probably also eagerly lower-case "other" schemes, i.e. that get-method after set-method("A") should return "a":

    Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.

  3. added
    wasi:implIssues pertaining to WASI implementation in Wasmtime
    on Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingwasi:implIssues pertaining to WASI implementation in Wasmtimewasi:spec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions