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

builder: expose methods for determining if HTTP/1.1 or HTTP/2 support are enabled #164

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

tobz
Copy link
Contributor

@tobz tobz commented Jan 24, 2025

Context

When utilizing TLS, a user must know if they have their server configured to handle HTTP/1.1 and/or HTTP/2 to properly determine which protocols can be negotiated over ALPN.

This PR adds two new methods to hyper_util::server::conn::auto::Builder: is_http1_available and is_http2_available, which tie back to the inner version value used to determine how to serve a connection. In exposing these, users can now programmatically build the ALPN protocol list rather than having to hardcode it, potentially ending up with a mismatch between the hardcoded list and the actual feature flags enabled for hyper/hyper-util.

@seanmonstar
Copy link
Member

Seems like a fine addition, wanna run fmt?

@tobz
Copy link
Contributor Author

tobz commented Jan 28, 2025

Doh! Should hopefully be all set now.

@seanmonstar seanmonstar merged commit 26e1e15 into hyperium:master Jan 28, 2025
16 checks passed
@tobz tobz deleted the tobz/server-conn-expose-protocols branch January 28, 2025 23:32
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.

2 participants