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

-17
View File
@@ -129,11 +129,6 @@ async fn serve_inner(
{
return builtin_error_response(StatusCode::FORBIDDEN, &method);
}
// An existing PHP script followed by PATH_INFO is a valid virtual PHP
// request, even though the full URL is not a filesystem path. Dispatch it
// before try_files can rewrite /static.php/skins/... to /index.php (as in
// Roundcube 1.7), while still applying the original path's rewrites and
// access controls above.
if let Ok(components) = path_components(&rewritten_path) {
if let Some((script_path, path_info)) = resolve_php_path_info(service, &components).await {
let script_components = path_components(&script_path).unwrap_or_default();
@@ -360,8 +355,6 @@ async fn serve_inner(
)
}
};
// Filtering in place avoids a second Vec allocation for large directories
// while retaining exactly the same visibility and hardening checks.
entries.retain(|entry| {
if htaccess::protected_component(service.htaccess.as_ref(), &entry.name) {
return false;
@@ -378,8 +371,6 @@ async fn serve_inner(
let mut response = Response::new(if method == Method::HEAD {
Body::empty()
} else {
// Move the generated listing into the response. Copying it doubles
// peak HTML allocation for large directory listings under load.
Body::from(listing)
});
response.headers_mut().insert(
@@ -399,10 +390,6 @@ async fn serve_inner(
response
}
/// Serve a decoded, validated routing path from a compiled Web Service.
/// The caller is responsible for normal vhost/location ACL/auth/routing selection;
/// this function performs filesystem handling plus optional Web Service routing,
/// precompressed delivery and bounded FastCGI/PHP-FPM execution.
pub async fn serve(
service: &CompiledService,
method: Method,
@@ -418,8 +405,6 @@ pub async fn serve(
crate::web_server::metrics::HeadersInFlight::new(&service.web_metrics.in_flight_headers);
let request_method = method.clone();
let mut response = serve_inner(service, method, headers, uri, path, body, context).await;
// HEAD carries the same metadata/status as GET, but no response body,
// including the generic filesystem and rewrite error paths.
if request_method == Method::HEAD {
*response.body_mut() = Body::empty();
}
@@ -436,8 +421,6 @@ pub async fn serve(
&request_method,
kind,
);
// Count bytes actually yielded by the Web Server body before downstream compression;
// never infer transferred bytes from Content-Length or count an unpolled response.
let web = service.web_metrics.clone();
let php = if matches!(kind, Some(crate::web_server::metrics::ResponseKind::Php)) {
service.php.as_ref().map(|p| p.metrics.clone())