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

Loading…
Cancel
Save