Skip to content

Map Host header to :authority pseudo-header in HTTP/2 #2942

Description

@sirfz

I bumped into this issue when using pyreqwest (a Python binding for reqwest) where I hit an API (I believe it's envoy edge-proxy) which proxies the url path to the host defined in the Host header. For example GET https://proxy-host.net/hello -H 'Host: actual-host.net', the proxy server "proxies" the /hello request to actual-host.net.

When using pyreqwest with HTTP/2 enabled, the request fails (503 from the server) because the Host header is stripped out of the request (since it's not allowed in HTTP/2).

However, when using curl, the request succeeds as curl maps the Host header to :authority pseudo-header when using HTTP/2 and this seems to be the behavior of other HTTP clients (such as Python's httpx).

Is this something that can be somehow supported by reqwest?

Referencing the original issue in pyreqwest: MarkusSintonen/pyreqwest#3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions