Switch HSTS enum to upper case.

Since the RelaxedBinder now supports it.
This commit is contained in:
Phillip Webb
2014-05-30 16:45:07 +01:00
parent a947eb7660
commit 67beba9464
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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);