From 7580ac5646156d35fd83b65f7d0bd959a896fb6c Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sat, 10 Dec 2022 12:34:07 +0100 Subject: [PATCH] actix-server: Make hello route work with HEAD This is a little bit tricky: https://github.com/actix/actix-web/issues/2702 --- actix-server/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actix-server/src/main.rs b/actix-server/src/main.rs index c73e7ad..4a43ef5 100644 --- a/actix-server/src/main.rs +++ b/actix-server/src/main.rs @@ -1,11 +1,11 @@ use std::path::Path; -use actix_web::{get, web, App, HttpRequest, HttpServer, Responder, Result}; +use actix_web::{get, route, web, App, HttpRequest, HttpServer, Responder, Result}; use actix_web::http::header; use actix_web::middleware::Logger; use actix_files::{Files, NamedFile}; -#[get("/hello/{name}")] +#[route("/hello/{name}", method="GET", method="HEAD")] async fn hello(params: web::Path, req: HttpRequest) -> Result { let name = params.into_inner(); -- 2.39.2