From 33d3fc7c9af4efb66f10b59a7ba442220e9239bf Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Thu, 13 Feb 2025 15:23:05 +0530 Subject: [PATCH 1/2] Update config.cpp --- tinyphone/config.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tinyphone/config.cpp b/tinyphone/config.cpp index 160bb06..9216df9 100644 --- a/tinyphone/config.cpp +++ b/tinyphone/config.cpp @@ -69,7 +69,9 @@ namespace tp { contentType = contentTypeIt->second; } - if (remoteConfig.code / 100 != 2 || contentType.rfind("application/json", 0) != 0 ) { + // Disable the content-type check. raw.githubusercontent.com doesn't return valid content-type + // if (remoteConfig.code / 100 != 2 ) || contentType.rfind("application/json", 0) != 0 ) { + if (remoteConfig.code / 100 != 2 ) { //Try Secondary Location message = "ERROR: Failed to fetch Remote Config from Primary!"; if (remoteConfig.error != "") From 3c91442c74edca12138b6032ccb9d40268e12479 Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Thu, 13 Feb 2025 15:27:26 +0530 Subject: [PATCH 2/2] Update config.cpp --- tinyphone/config.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyphone/config.cpp b/tinyphone/config.cpp index 9216df9..c71b5ac 100644 --- a/tinyphone/config.cpp +++ b/tinyphone/config.cpp @@ -70,6 +70,7 @@ namespace tp { } // Disable the content-type check. raw.githubusercontent.com doesn't return valid content-type + // Security Note: JSON parsing validation still occurs later to ensure content validity. // if (remoteConfig.code / 100 != 2 ) || contentType.rfind("application/json", 0) != 0 ) { if (remoteConfig.code / 100 != 2 ) { //Try Secondary Location