From 18a13911ba992b6726c492c395251fb1495c31e0 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 12 Apr 2025 18:53:35 -0700 Subject: [PATCH] fix: handle content-encoding "e" (#1588) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1588 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index 160a93c8..c8b19583 100644 --- a/src/app.ts +++ b/src/app.ts @@ -16,9 +16,9 @@ import { webuiRouter } from "@/src/routes/webui"; const app = express(); app.use((req, _res, next) => { - // 38.5.0 introduced "ezip" for encrypted body blobs. + // 38.5.0 introduced "ezip" for encrypted body blobs and "e" for request verification only (encrypted body blobs with no application data). // The bootstrapper decrypts it for us but having an unsupported Content-Encoding here would still be an issue for Express, so removing it. - if (req.headers["content-encoding"] == "ezip") { + if (req.headers["content-encoding"] == "ezip" || req.headers["content-encoding"] == "e") { req.headers["content-encoding"] = undefined; } next();