Browse Source

Suppress misleading warning message

QString::split() was giving a non-empty QStringList, and
that caused Session::setBannedIPs() to emit misleading warning message.
adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
2729c0cb6d
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/webui/api/appcontroller.cpp
  2. 4
      src/webui/webapplication.cpp

2
src/webui/api/appcontroller.cpp

@ -483,7 +483,7 @@ void AppController::setPreferencesAction() @@ -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

4
src/webui/webapplication.cpp

@ -473,8 +473,8 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons @@ -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();

Loading…
Cancel
Save