Description
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
- Store the
slice
of the read_bytes after parsing the headers as a request extension - Hyper Client uses it in encoding headers if the extension is present
Describe alternatives you've considered
- Implement the proxy from the scratch
- This requires us to implement the most of the HTTP server functionality that Hyper already has.
- Just use Hyper request
- There is always risk that Hyper decode the request head bytes compared to the existing server