Skip to content

Std.Http server answers HTTP/1.0 requests with an HTTP/1.0 status-line #16332

Closed

Description

@kmrasmussen

Description

RFC 9110 §6.2: "A server SHOULD send a response version equal to the highest version to which the
server is conformant that has a major version less than or equal to the one received in the
request." Std.Http's H1 machine writes the request's version instead (writeHead, version := machine.reader.messageHead.version), so a 1.0 request gets HTTP/1.0 200 OK.

#eval statusLine "GET / HTTP/1.1\r\nHost: a\r\n\r\n"   -- "HTTP/1.1 200 OK"
#eval statusLine "GET / HTTP/1.0\r\n\r\n"              -- "HTTP/1.0 200 OK"

(Repro.lean attached: feeds the bytes to Protocol.H1.Machine .receiving and answers 200.)

Expected

HTTP/1.1 200 OK in both cases, with the 1.0-specific framing (no chunked, Connection: close
unless keep-alive was asked) unchanged.

Versions

v4.35.0, nightly-2026-11-06, master 2026-11-07 (encodeServerHead).


Found while auditing RFC 9110/9112 conformance of Std.Http (Lean v4.35.0, re-checked against master 2026-11-07). Standalone repro available on request.

This report was prepared and written with AI assistance (Claude).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions