Skip to content

Expose raw request head bytes in Hyper Server and support using it in Hyper Client #3901

Open
@heiwais25

Description

@heiwais25

Is your feature request related to a problem? Please describe.

This is a hard blocker to use Hyper as a proxy server without worrying about the unexpected normalization by Hyper.

We want to use Hyper as a proxy server in front of the existing services, which are very old. The old services have its own custom logic to support the requests even for non-RFC compliant requests to have backward compatibility. Using Hyper as a proxy has a potential problem since it has its own parsing and normalization logic, such as lower casing of the header name.

The best situation is that Hyper can capture the raw head bytes after parsing it and Hyper client supports it to encode it to bytes instead of using the normalized request. This helps us to avoid any issues in normalization since we will forward the raw bytes.

Describe the solution you'd like

  1. Store the slice of the read_bytes after parsing the headers as a request extension
  2. Hyper Client uses it in encoding headers if the extension is present

Describe alternatives you've considered

  1. Implement the proxy from the scratch
    • This requires us to implement the most of the HTTP server functionality that Hyper already has.
  2. Just use Hyper request
    • There is always risk that Hyper decode the request head bytes compared to the existing server

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature. This is adding a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions