From 2729c0cb6d24533aca394b75db2ccd1a627bd103 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 23 Apr 2020 12:21:24 +0800 Subject: [PATCH] Suppress misleading warning message QString::split() was giving a non-empty QStringList, and that caused Session::setBannedIPs() to emit misleading warning message. --- src/webui/api/appcontroller.cpp | 2 +- src/webui/webapplication.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 4dd335cd9..f51e2876c 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -483,7 +483,7 @@ void AppController::setPreferencesAction() if (hasKey("ip_filter_trackers")) session->setTrackerFilteringEnabled(it.value().toBool()); if (hasKey("banned_IPs")) - session->setBannedIPs(it.value().toString().split('\n')); + session->setBannedIPs(it.value().toString().split('\n', QString::SkipEmptyParts)); // Speed // Global Rate Limits diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index 8635eb61c..ec5073d89 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -473,8 +473,8 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons header(QLatin1String(Http::HEADER_CONTENT_SECURITY_POLICY), m_contentSecurityPolicy); if (m_useCustomHTTPHeaders) { - for (const CustomHTTPHeader &i : asConst(m_customHTTPHeaders)) - header(i.name, i.value); + for (const CustomHTTPHeader &customHeader : asConst(m_customHTTPHeaders)) + header(customHeader.name, customHeader.value); } return response();