Switch HSTS enum to upper case.

Since the RelaxedBinder now supports it.
pull/1016/head
Phillip Webb 11 years ago
parent a947eb7660
commit 67beba9464

@ -121,7 +121,7 @@ public class SecurityProperties implements SecurityPrequisite {
public static class Headers { public static class Headers {
public static enum HSTS { public static enum HSTS {
none, domain, all NONE, DOMAIN, ALL
} }
private boolean xss; private boolean xss;
@ -132,7 +132,7 @@ public class SecurityProperties implements SecurityPrequisite {
private boolean contentType; private boolean contentType;
private HSTS hsts = HSTS.all; private HSTS hsts = HSTS.ALL;
public boolean isXss() { public boolean isXss() {
return this.xss; return this.xss;

@ -93,8 +93,8 @@ public class SpringBootWebSecurityConfiguration {
public static void configureHeaders(HeadersConfigurer<?> configurer, public static void configureHeaders(HeadersConfigurer<?> configurer,
SecurityProperties.Headers headers) throws Exception { SecurityProperties.Headers headers) throws Exception {
if (headers.getHsts() != Headers.HSTS.none) { if (headers.getHsts() != Headers.HSTS.NONE) {
boolean includeSubdomains = headers.getHsts() == Headers.HSTS.all; boolean includeSubdomains = headers.getHsts() == Headers.HSTS.ALL;
HstsHeaderWriter writer = new HstsHeaderWriter(includeSubdomains); HstsHeaderWriter writer = new HstsHeaderWriter(includeSubdomains);
writer.setRequestMatcher(AnyRequestMatcher.INSTANCE); writer.setRequestMatcher(AnyRequestMatcher.INSTANCE);
configurer.addHeaderWriter(writer); configurer.addHeaderWriter(writer);

Loading…
Cancel
Save