fix: security headers not enabled by default when using config (#216)
now the `security-headers` are enabled by default (not defined in
config.toml) if `http2` is enabled.
Diff
src/settings/mod.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -197,8 +197,13 @@ impl Settings {
if let Some(v) = general.https_redirect_from_hosts {
https_redirect_from_hosts = v
}
if let Some(v) = general.security_headers {
security_headers = v
match general.security_headers {
Some(v) => security_headers = v,
_ => {
if http2 {
security_headers = true;
}
}
}
if let Some(ref v) = general.cors_allow_origins {
cors_allow_origins = v.to_owned()