From: Ian Jackson Date: Wed, 30 Mar 2022 22:43:02 +0000 (+0100) Subject: actix: Document the situation with HEAD etc. X-Git-Tag: otter-1.0.0~72 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a9cab2570283054ddc4bd13596b8993bac2f3add;p=otter.git 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 --- 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,