镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

On recoverable protocol errors from real-world usage. #96

Description

@lovelydinosaur

Figured I'd raise this based on some useful real world feedback in encode/httpx#767 which includes a bunch of cases that urllib3 deals with, but h11 (correctly) identifies as protocol errors.

There's four seperate classes of protocol errors mentioned in that ticket...

  1. Multiple Content-Length headers. (Already covered by Handle multiple Content-Length headers with the same value #92)
  2. Status code outside of valid range. (Returned a "600")
  3. "malformed data" - I believe triggered by a Server: header with no value.
  4. "Receive buffer too long" - Presumably an oversized header or similar but cause wasn't immediately clear.

I'm wondering if you've any thoughts on what (if anything) we might usefully do to have h11 be able to be lenient to some of these protocol errors?

Purely based on the feedback in that particular ticket, and given that #92 already covers one of the cases...

  • Would it be reasonable to be lenient to invalid status code ranges?
  • Would it be reasonable to switch the header regex to allow empty values even tho not strictly valid?

Activity

  1. lovelydinosaur commented on Jan 16, 2020

    @lovelydinosaur
    ContributorAuthor

    Apologies, I just noticed that #95 was already filed here.

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