0.34.6_repo_cleanup

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 09:31:15 +02:00
1 parent ce1a90397c
commit 133d2f0f91
273 files changed
+5969 -6926

No files matched your search

-14
View File
@@ -21,7 +21,6 @@ use http::{
};
use http_body::Body as HttpBody;
use http_body_util::BodyExt;
/// Mark responses whose configured outbound policies were already applied.
#[derive(Clone)]
struct ResponseRulesApplied;
#[derive(Clone)]
@@ -146,9 +145,6 @@ fn retry_safe_method(method: &Method) -> bool {
}
fn upstream_uri(backend: &crate::config::CompiledBackend, suffix: &str) -> Option<Uri> {
// Reuse the validated scheme and authority from the immutable compiled
// backend. Only the untrusted path/query is parsed per request. This also
// prevents accidental authority changes from rewritten paths.
let path: http::uri::PathAndQuery = suffix.parse().ok()?;
let mut parts = backend.request_origin_uri.clone().into_parts();
parts.path_and_query = Some(path);
@@ -167,12 +163,6 @@ fn legacy_websocket_origin(
HeaderValue::from_str(&format!("{scheme}://{authority}")).ok()
}
/// Align HTTP request authority with the selected public/backend Host.
///
/// TCP/DNS/TLS still target the configured origin in TimedConnector. Strict
/// HTTP/2 sends :authority without a second Host field. HTTPS ALPN mixed
/// mode must retain the Host field: Hyper's legacy H1-compatible request may
/// be sent over an H2-negotiated connection, and H1 fallback needs Host.
fn upstream_request_target(
uri: Uri,
headers: &mut HeaderMap,
@@ -191,7 +181,6 @@ fn upstream_request_target(
}
let selected = headers.get(HOST).unwrap_or(&backend.host_header);
let authority: http::uri::Authority = selected.to_str().ok()?.parse().ok()?;
// Never treat a userinfo URI or a malformed Host as a valid HTTP authority.
if authority.host().is_empty() || authority.as_str().contains('@') {
return None;
}
@@ -212,8 +201,6 @@ fn upstream_request_version(
backend: &crate::config::CompiledBackend,
websocket_h2: bool,
) -> Version {
// 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
@@ -238,7 +225,6 @@ fn retry_request(
let mut request = Request::builder()
.method(method.clone())
.version(version)
// Keep the original URI for authority adjustment after building the request.
.uri(uri.clone())
.body(Body::empty())
.ok()?;