aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorAlex Auvolat <lx@deuxfleurs.fr>2025-02-17 18:47:06 +0100
committerAlex Auvolat <lx@deuxfleurs.fr>2025-02-17 18:47:06 +0100
commitc5df820e2c2b4bff5e239b8e99f07178b98b3f5a (patch)
tree26fa3dd297ee1c8bb55f5f7573a5c3396b030507 /src/web
parenta04d6cd5b8a3acffb8daeee00aed744fb1a78ea3 (diff)
downloadgarage-c5df820e2c2b4bff5e239b8e99f07178b98b3f5a.tar.gz
garage-c5df820e2c2b4bff5e239b8e99f07178b98b3f5a.zip
api: start refactor of signature to calculate checksums earlier
Diffstat (limited to 'src/web')
-rw-r--r--src/web/web_server.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs
index e73dab48..34ba834c 100644
--- a/src/web/web_server.rs
+++ b/src/web/web_server.rs
@@ -1,6 +1,6 @@
use std::fs::{self, Permissions};
use std::os::unix::prelude::PermissionsExt;
-use std::{convert::Infallible, sync::Arc};
+use std::sync::Arc;
use tokio::net::{TcpListener, UnixListener};
use tokio::sync::watch;
@@ -163,6 +163,8 @@ impl WebServer {
metrics_tags.push(KeyValue::new("host", host_header.clone()));
}
+ let req = req.map(|_| ());
+
// The actual handler
let res = self
.serve_file(&req)
@@ -218,7 +220,7 @@ impl WebServer {
async fn serve_file(
self: &Arc<Self>,
- req: &Request<IncomingBody>,
+ req: &Request<()>,
) -> Result<Response<BoxBody<ApiError>>, Error> {
// Get http authority string (eg. [::1]:3902 or garage.tld:80)
let authority = req
@@ -322,7 +324,7 @@ impl WebServer {
// Create a fake HTTP request with path = the error document
let req2 = Request::builder()
.uri(format!("http://{}/{}", host, &error_document))
- .body(empty_body::<Infallible>())
+ .body(())
.unwrap();
match handle_get_without_ctx(