Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): send only path of URI in request #3438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kiron1
Copy link
Contributor

@kiron1 kiron1 commented Nov 22, 2023

A client request must transmit the URI as absolute path and the authority in the Host header. Only when the request goes via a HTTP proxy, the URI in the request shall contain the network location as well. Current implementation transmit the network location unconditionally.

In Hyper 0.14 the connection knew if it is connected to an proxy or directly to a HTTP server. The connection then wrote the network location conditionally only when a proxy is involved.

This PR updates the client example such that only the path is used for the URI in the request.

According to the RFC both cases must work, but after this PR it is more clear that the user is responsible to form the correct URI value.

To allow for transition to absoluteURIs in all requests in future
versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI
form in requests, even though HTTP/1.1 clients will only generate
them in requests to proxies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant