From a9cab2570283054ddc4bd13596b8993bac2f3add Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Mar 2022 23:43:02 +0100 Subject: [PATCH] actix: Document the situation with HEAD etc. This is not very good really, but I guess it will do for now. Signed-off-by: Ian Jackson --- TODO | 1 - daemon/main.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 343b87d2..a817962a 100644 --- a/TODO +++ b/TODO @@ -1,2 +1 @@ -http2 HEAD requests Build on stable diff --git a/daemon/main.rs b/daemon/main.rs index 0e105bd5..6b903724 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -161,6 +161,16 @@ struct LoadingRenderContext<'r> { movehist_len_i: usize, movehist_len_max: usize, } + +// This business with method="GET", method="HEAD" is necessary because +// actix_web 4's #[get] macro does not serve HEAD requests. +// Apparently, this is because they are broken in its HTTP/2 +// implementation. But, also, the HTTP/2 implementation is not +// exposed unless you have actix do TLS (which is where the version +// negotiation ends up). So this is fine? +// +// Upstream issue: +// https://github.com/actix/actix-web/issues/2702 #[route("/", method="GET", method="HEAD")] #[throws(FER)] async fn r_loading_p(ia: PlayerQueryString, -- 2.30.2