-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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.