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 1/2] 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(); }); -- 2.47.2 From b300efeb965d87fe36c7e4526a36b70eaede811b Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 5 May 2025 13:56:53 +0200 Subject: [PATCH 2/2] note --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 44abf812..36c1437e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -22,7 +22,7 @@ app.use((req, _res, next) => { 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. + // 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"; } -- 2.47.2