From 238af294fe8eb843d8aebbc2461b9c9596343fab Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 5 May 2025 04:57:44 -0700 Subject: [PATCH] fix: login failure on U18 (#1983) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1983 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/app.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app.ts b/src/app.ts index 291372f0e..36c1437ee 100644 --- a/src/app.ts +++ b/src/app.ts @@ -21,6 +21,12 @@ app.use((req, _res, next) => { if (req.headers["content-encoding"] == "ezip" || req.headers["content-encoding"] == "e") { req.headers["content-encoding"] = undefined; } + + // U18 uses application/x-www-form-urlencoded even tho the data is JSON which Express doesn't like. + if (req.headers["content-type"] == "application/x-www-form-urlencoded") { + req.headers["content-type"] = "application/octet-stream"; + } + next(); });