From f041c5161b2f68e17c3b2915e2b9372a6bdf1aea Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 5 May 2025 05:18:12 +0200 Subject: [PATCH] fix: login failure on U18 --- src/app.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app.ts b/src/app.ts index 291372f0..44abf812 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 and below use 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(); });