This commit is contained in:
Mateusz Gruszczyński committed 2026-10-13 21:29:57 +02:00
1 parent bb025dcf44
commit b0f211555a
74 files changed
+6089 -556

No files matched your search

+8 -2
View File
@@ -14,13 +14,13 @@ use axum::{
Extension, Router,
};
use body::{Direction, Exchange, MeteredBody};
use bytes::Bytes;
use http::{
header::{HeaderValue, HOST, USER_AGENT},
HeaderMap, Method, StatusCode, Uri, Version,
};
use http_body::Body as HttpBody;
use http_body_util::BodyExt;
use bytes::Bytes;
#[derive(Clone)]
struct ResponseRulesApplied;
#[derive(Clone)]
@@ -162,7 +162,13 @@ fn upstream_request_version(
backend: &crate::config::CompiledBackend,
websocket_h2: bool,
) -> Version {
if websocket_h2 || backend.protocol == crate::config::UpstreamProtocol::Http2 {
// HTTPS legacy `http2` must still permit H1 after ALPN negotiation.
// Cleartext legacy `http2` and strict `h2` use H2 (prior knowledge on HTTP).
if websocket_h2
|| backend.protocol == crate::config::UpstreamProtocol::H2
|| (backend.protocol == crate::config::UpstreamProtocol::Http2
&& backend.origin.starts_with("http://"))
{
Version::HTTP_2
} else {
Version::HTTP_11