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

Correctly handle HTTP/1.0 Keep-Alive #20

Open
mfelsche opened this issue Dec 10, 2020 · 0 comments
Open

Correctly handle HTTP/1.0 Keep-Alive #20

mfelsche opened this issue Dec 10, 2020 · 0 comments

Comments

@mfelsche
Copy link
Contributor

RFC 2068 states:

When it connects to an origin server, an HTTP client MAY send the
   Keep-Alive connection-token in addition to the Persist connection-
   token:

          Connection: Keep-Alive

   An HTTP/1.0 server would then respond with the Keep-Alive connection
   token and the client may proceed with an HTTP/1.0 (or Keep-Alive)
   persistent connection.

Currently users need to check for the Request version to be HTTP10 and for the right Connection header and then set the response header accordingly. This should not be the users responsibility. But right now, especially in the ResponseBuilder it is not possible to prepopulate it with headers or any other values based on the request and maybe some server settings. When the Response is passed to the Sessions it is too late as by then the Response is val not mutable anymore. With the ResponseBuilder we only pass the response data as bytes over, also no possibility to change something here. The best way would be to initialize the response builder with HTTP version, Status Code and the given Request, so it can incorporate the logic necessary for handling HTTP/1.0 keep alive.

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

No branches or pull requests

1 participant