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

gracefully fail HTTP/1.0 connections #152

Open
yoshuawuyts opened this issue Nov 5, 2020 · 2 comments · May be fixed by #178
Open

gracefully fail HTTP/1.0 connections #152

yoshuawuyts opened this issue Nov 5, 2020 · 2 comments · May be fixed by #178

Comments

@yoshuawuyts
Copy link
Member

yoshuawuyts commented Nov 5, 2020

Currently our handling of HTTP/1.0 connections is rather blunt: we log an error and exit. We could do better by sending back a 426: Upgrade Required header with an Upgrade: HTTP/1.1 field. A client that sends an HTTP/1.0 request will receive a more informative response that's not "TCP connection aborted", and if it's sufficiently advanced it may even know to upgrade to HTTP/1.1 and try again.

We may choose to add support for HTTP/1.0 proper in the future. But that requires a significant amount of design work and research, and until then we can at least ensure we fail more gracefully when detecting HTTP/1.0 connections.

response payload

HTTP/1.0 426 Upgrade Required 
Upgrade: HTTP/1.1
Connection: Upgrade 
Content-Length: 53
Content-Type: text/plain 

This service requires use of the HTTP/1.1 protocol.
@yoshuawuyts yoshuawuyts changed the title gracefully handle HTTP/1.0 connections gracefully fail HTTP/1.0 connections Nov 5, 2020
@jbr
Copy link
Member

jbr commented Dec 19, 2020

chose to implement this with 505 http version not supported, since it's not properly an upgrade, in the sense of http upgrades

@yoshuawuyts
Copy link
Member Author

@jbr oh yeah, that's entirely reasonable -- and with HTTP/1.0 support enabled by setting the host, there's definitely a clear path to "upgrading". Albeit through a somewhat more manual approach.

@jbr jbr linked a pull request Jan 25, 2021 that will close this issue
Draft
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 a pull request may close this issue.

2 participants