use of org.springframework.security.web.header.HeaderWriterFilter in project spring-security by spring-projects.
the class HeadersConfigurer method configure.
@Override
public void configure(H http) {
HeaderWriterFilter headersFilter = createHeaderWriterFilter();
http.addFilter(headersFilter);
}
use of org.springframework.security.web.header.HeaderWriterFilter in project spring-security by spring-projects.
the class HeadersConfigurer method createHeaderWriterFilter.
/**
* Creates the {@link HeaderWriter}
* @return the {@link HeaderWriter}
*/
private HeaderWriterFilter createHeaderWriterFilter() {
List<HeaderWriter> writers = getHeaderWriters();
if (writers.isEmpty()) {
throw new IllegalStateException("Headers security is enabled, but no headers will be added. Either add headers or disable headers security");
}
HeaderWriterFilter headersFilter = new HeaderWriterFilter(writers);
headersFilter = postProcess(headersFilter);
return headersFilter;
}
Aggregations