Switch HSTS enum to upper case.
Since the RelaxedBinder now supports it.
This commit is contained in:
@@ -121,7 +121,7 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
public static class Headers {
|
||||
|
||||
public static enum HSTS {
|
||||
none, domain, all
|
||||
NONE, DOMAIN, ALL
|
||||
}
|
||||
|
||||
private boolean xss;
|
||||
@@ -132,7 +132,7 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
|
||||
private boolean contentType;
|
||||
|
||||
private HSTS hsts = HSTS.all;
|
||||
private HSTS hsts = HSTS.ALL;
|
||||
|
||||
public boolean isXss() {
|
||||
return this.xss;
|
||||
|
||||
@@ -93,8 +93,8 @@ public class SpringBootWebSecurityConfiguration {
|
||||
|
||||
public static void configureHeaders(HeadersConfigurer<?> configurer,
|
||||
SecurityProperties.Headers headers) throws Exception {
|
||||
if (headers.getHsts() != Headers.HSTS.none) {
|
||||
boolean includeSubdomains = headers.getHsts() == Headers.HSTS.all;
|
||||
if (headers.getHsts() != Headers.HSTS.NONE) {
|
||||
boolean includeSubdomains = headers.getHsts() == Headers.HSTS.ALL;
|
||||
HstsHeaderWriter writer = new HstsHeaderWriter(includeSubdomains);
|
||||
writer.setRequestMatcher(AnyRequestMatcher.INSTANCE);
|
||||
configurer.addHeaderWriter(writer);
|
||||
|
||||
Reference in New Issue
Block a user