From 74a79d85ee32029eb38bb58e98fa2ab240369da9 Mon Sep 17 00:00:00 2001 From: aiamnezia Date: Fri, 14 Feb 2025 16:48:12 +0400 Subject: [PATCH] Simplify undefined config handling in ConfigManager --- proxyserver/src/configmanager.cpp | 4 +--- proxyserver/src/httpapi.cpp | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/proxyserver/src/configmanager.cpp b/proxyserver/src/configmanager.cpp index 6003a09..39ba070 100644 --- a/proxyserver/src/configmanager.cpp +++ b/proxyserver/src/configmanager.cpp @@ -436,9 +436,7 @@ QMap ConfigManager::getConfigsByUuids(const QStringList &u else { Logger::getInstance().warning(QString("Config not found for UUID: %1").arg(uuid)); - QJsonObject undefinedConfig; - undefinedConfig["status"] = "Undefined"; - result[uuid] = undefinedConfig; + result[uuid] = QJsonObject(); } } diff --git a/proxyserver/src/httpapi.cpp b/proxyserver/src/httpapi.cpp index f6be7f1..5612ed9 100644 --- a/proxyserver/src/httpapi.cpp +++ b/proxyserver/src/httpapi.cpp @@ -6,6 +6,7 @@ #include #include #include +#include HttpApi::HttpApi(QWeakPointer service, QObject* parent) : QObject(parent) @@ -213,8 +214,8 @@ QJsonObject HttpApi::handleGetPing() const QHttpServerResponse HttpApi::handleGetConfigs(const QHttpServerRequest &request) { if (auto service = m_service.lock()) { - // Get UUIDs from query parameters if present - QString uuidList = request.query().queryItemValue("uuid"); + // Get UUIDs from query parameters if present and decode URL-encoded characters + QString uuidList = QUrl::fromPercentEncoding(request.query().queryItemValue("uuid").toUtf8()); Logger::getInstance().debug(QString("UUID filter: %1").arg(uuidList.isEmpty() ? "none" : uuidList)); QMap configs;