WebUI: Implement "Secure" flag for session cookie. Closes #11724
This commit is contained in:
Mike Tzou 2019-12-25 13:06:40 +08:00 committed by GitHub
commit fea39fbcf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 0 deletions

View file

@ -653,6 +653,16 @@ void Preferences::setWebUiCSRFProtectionEnabled(const bool enabled)
setValue("Preferences/WebUI/CSRFProtection", enabled);
}
bool Preferences::isWebUiSecureCookieEnabled() const
{
return value("Preferences/WebUI/SecureCookie", true).toBool();
}
void Preferences::setWebUiSecureCookieEnabled(const bool enabled)
{
setValue("Preferences/WebUI/SecureCookie", enabled);
}
bool Preferences::isWebUIHostHeaderValidationEnabled() const
{
return value("Preferences/WebUI/HostHeaderValidation", true).toBool();