Skip to content

Support HTTP/0.9 responses in the client #2468

Closed
@nox

Description

@nox

There are servers out there that sometimes reply with HTTP/0.9 responses, even modern-ish stack (we saw such responses from MSFT servers for example).

I'm filing this here and not on the httparse repo because this is a substantial change worth discussing in the open, and because we need to think about how to support it. Firefox for example has some logic to content-sniff the start of an actual HTTP/1.* response in the first 4KB of received data on the first request made on the connection, and this is obviously not code that should live in httparse.

As a start, I feel like Hyper should check whether the response starts with "HTTP" at the beginning of the data it received, and if not, maybe it should pretend it saw HTTP/1.0 200 OK\r\n\r\n.

I say HTTP/1.0 and not HTTP/0.9 because it is literally impossible for httparse::Response to represent 0.9 in its version field.

Activity

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

    A-clientArea: client.A-http1Area: HTTP/1 specific.C-featureCategory: feature. This is adding a new feature.E-mediumEffort: medium. Some knowledge of how hyper internal works would be useful.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions