mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Add option to control WebUI clickjacking protection
Some users actually want embedding WebUI into their custom build iframe. Closes #7370.
This commit is contained in:
@@ -205,6 +205,8 @@ void AppController::preferencesAction()
|
||||
for (const Utils::Net::Subnet &subnet : copyAsConst(pref->getWebUiAuthSubnetWhitelist()))
|
||||
authSubnetWhitelistStringList << Utils::Net::subnetToString(subnet);
|
||||
data["bypass_auth_subnet_whitelist"] = authSubnetWhitelistStringList.join("\n");
|
||||
// Security
|
||||
data["web_ui_clickjacking_protection_enabled"] = pref->isWebUiClickjackingProtectionEnabled();
|
||||
// Update my dynamic domain name
|
||||
data["dyndns_enabled"] = pref->isDynDNSEnabled();
|
||||
data["dyndns_service"] = pref->getDynDNSService();
|
||||
@@ -479,6 +481,9 @@ void AppController::setPreferencesAction()
|
||||
// recognize new lines and commas as delimiters
|
||||
pref->setWebUiAuthSubnetWhitelist(m["bypass_auth_subnet_whitelist"].toString().split(QRegularExpression("\n|,"), QString::SkipEmptyParts));
|
||||
}
|
||||
// Security
|
||||
if (m.contains("web_ui_clickjacking_protection_enabled"))
|
||||
pref->setWebUiClickjackingProtectionEnabled(m["web_ui_clickjacking_protection_enabled"].toBool());
|
||||
// Update my dynamic domain name
|
||||
if (m.contains("dyndns_enabled"))
|
||||
pref->setDynDNSEnabled(m["dyndns_enabled"].toBool());
|
||||
|
||||
Reference in New Issue
Block a user