Skip to content

Commit

Permalink
Simplify undefined config handling in ConfigManager
Browse files Browse the repository at this point in the history
  • Loading branch information
aiamnezia committed Feb 14, 2025
1 parent f9fb01e commit 74a79d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions proxyserver/src/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,7 @@ QMap<QString, QJsonObject> 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();
}
}

Expand Down
5 changes: 3 additions & 2 deletions proxyserver/src/httpapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <QDateTime>
#include <QHostAddress>
#include <QDebug>
#include <QUrl>

HttpApi::HttpApi(QWeakPointer<IProxyService> service, QObject* parent)
: QObject(parent)
Expand Down Expand Up @@ -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<QString, QJsonObject> configs;
Expand Down

0 comments on commit 74a79d8

Please sign in to comment.