Add option for WebUI Host header validation

Closes #9743.
This commit is contained in:
Chocobo1 2018-11-16 13:41:27 +08:00
parent 39ee27785c
commit 344e47dcfb
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
8 changed files with 67 additions and 23 deletions

View file

@ -626,6 +626,16 @@ void Preferences::setWebUiCSRFProtectionEnabled(bool enabled)
setValue("Preferences/WebUI/CSRFProtection", enabled);
}
bool Preferences::isWebUIHostHeaderValidationEnabled() const
{
return value("Preferences/WebUI/HostHeaderValidation", true).toBool();
}
void Preferences::setWebUIHostHeaderValidationEnabled(const bool enabled)
{
setValue("Preferences/WebUI/HostHeaderValidation", enabled);
}
bool Preferences::isWebUiHttpsEnabled() const
{
return value("Preferences/WebUI/HTTPS/Enabled", false).toBool();