From 88664a86d100ba3a28f360e9563ffe45216a6875 Mon Sep 17 00:00:00 2001 From: Radiquum Date: Thu, 28 Aug 2025 21:47:34 +0500 Subject: [PATCH] api-prox/fix: discovery for not logged in users --- api-prox/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api-prox/index.ts b/api-prox/index.ts index 98856c1..2f399f0 100644 --- a/api-prox/index.ts +++ b/api-prox/index.ts @@ -226,7 +226,9 @@ app.get("/*path", async (req, res) => { if ( !apiResponse || !apiResponse.ok || - apiResponse.headers.get("content-type") != "application/json" + (apiResponse.headers.get("content-type") != "application/json" && + apiResponse.headers.get("content-type") != + "application/json;charset=UTF-8") ) { logger.error( `Failed to fetch: '${url.protocol}//${url.hostname}${url.pathname}', Path probably doesn't exist` @@ -277,7 +279,7 @@ app.post("/*path", async (req, res) => { "application/json", "application/x-www-form-urlencoded", "multipart/form-data", - "x-unknown/unknown" + "x-unknown/unknown", ]; const isSupported = supportedContentTypes.includes( @@ -335,7 +337,9 @@ app.post("/*path", async (req, res) => { if ( !apiResponse || !apiResponse.ok || - apiResponse.headers.get("content-type") != "application/json" + (apiResponse.headers.get("content-type") != "application/json" && + apiResponse.headers.get("content-type") != + "application/json;charset=UTF-8") ) { logger.error( `Failed to post: '${url.protocol}//${url.hostname}${url.pathname}', Path probably doesn't exist`