Skip to content

hyper::Error should distinguish http1 TooLarge from other parse errors #2462

@acfoltzer

Description

@acfoltzer

Currently if an http1 message head exceeds the http1_max_buf_size, a hyper::Error is returned where err.is_parse() == true. This is indistinguishable from other errors that httparse might bubble up, which poses a problem for deciding how to respond to these errors. A TooLarge can occur just because of the choices made when setting up the max buffer size (many implementations default to 1MB vs the ~400KB default for hyper), vs. an actually malformed HTTP message which probably indicates a misbehaving server.

Could we add a new method to hyper::Error that distinguishes these? hyper::Error::is_buf_size_exceeded() as a strawman?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-errorArea: error handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions