Skip to content

Normalize @scheme to lowercase per RFC 9421 §2.2.4 #45

Open

Description

@yaronf

Summary

RFC 9421 §2.2.4 requires:

The component value is the scheme as a lowercase string as defined in [HTTP], Section 4.2. While the scheme itself is case insensitive, it MUST be normalized to lowercase for inclusion in the signature base.

scScheme currently returns url.Scheme unchanged. Callers that set the scheme via MessageConfig.WithScheme (or otherwise supply a non-lowercase scheme) can therefore emit a non-compliant @scheme component.

Notes

  • Related to @authority normalization in Normalize @authority according to RFC 9421 #44.
  • parseRequest already sets "http" / "https" in lowercase when deriving from req.TLS, so the common path is fine; the gap is non-normalized scheme values from WithScheme / message construction.

Activity

  1. yaronf commented on Nov 14, 2026

    @yaronf
    OwnerAuthor

    Noted while reviewing #44 (@authority normalization). Tracking separately so that PR can stay focused.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions