Skip to content

hyper should validate header fields on a header block with the CONNECT method #319

Open
@alexwlchan

Description

@alexwlchan

RFC 7540 § 8.3:

In HTTP/2, the CONNECT method is used to establish a tunnel over a
single HTTP/2 stream to a remote host for similar purposes. The HTTP
header field mapping works as defined in Section 8.1.2.3 ("Request
Pseudo-Header Fields"), with a few differences. Specifically:

  • The ":method" pseudo-header field is set to "CONNECT".
  • The ":scheme" and ":path" pseudo-header fields MUST be omitted.
  • The ":authority" pseudo-header field contains the host and port to
    connect to (equivalent to the authority-form of the request-target
    of CONNECT requests (see [RFC7230], Section 5.3)).

A CONNECT request that does not conform to these restrictions is
malformed (Section 8.1.2.6).

Currently hyper doesn’t do anything to check this. We should add a check in utilities.py (probably somewhere in _reject_pseudo_header_fields()) that we conform to these restrictions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions