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

hyper-util panic when http2 is disabled #2192

Closed
paolobarbolini opened this issue Mar 20, 2024 · 1 comment · Fixed by #2194
Closed

hyper-util panic when http2 is disabled #2192

paolobarbolini opened this issue Mar 20, 2024 · 1 comment · Fixed by #2194

Comments

@paolobarbolini
Copy link
Contributor

Cargo.toml

[package]
name = "reqwest-test"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1", features = ["macros", "rt"] }
# same with `native-tls-alpn`
reqwest = { version = "=0.12.0", default-features = false, features = ["rustls-tls-native-roots"] }

src/main.rs

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let text = reqwest::get("https://www.cloudflare.com/cdn-cgi/trace")
        .await
        .unwrap()
        .text()
        .await
        .unwrap();
    println!("{text}");
}

Output

thread 'main' panicked at /home/<redacted>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-util-0.1.3/src/client/legacy/client.rs:554:33:
http2 feature is not enabled
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@paolobarbolini
Copy link
Contributor Author

I'm looking into what's causing it. I haven't seen how hyper v1 works yet and I'm curious to learn.

seanmonstar pushed a commit that referenced this issue Mar 20, 2024
The fix is only ask for h2 ALPN iff the http2 feature is enabled.

Closes #2192
Nutomic pushed a commit to Nutomic/reqwest that referenced this issue Nov 7, 2024
…#2194)

The fix is only ask for h2 ALPN iff the http2 feature is enabled.

Closes seanmonstar#2192
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.

1 participant