List of usage examples for org.springframework.security.web.util.matcher RequestHeaderRequestMatcher RequestHeaderRequestMatcher
public RequestHeaderRequestMatcher(String expectedHeaderName)
From source file:sample.session.SmartHttpSessionStrategy.java
@Autowired public SmartHttpSessionStrategy(ContentNegotiationStrategy contentNegotiationStrategy) { this(new CookieHttpSessionStrategy(), new HeaderHttpSessionStrategy()); MediaTypeRequestMatcher matcher = new MediaTypeRequestMatcher(contentNegotiationStrategy, Arrays.asList(MediaType.TEXT_HTML)); matcher.setIgnoredMediaTypes(Collections.singleton(MediaType.ALL)); RequestHeaderRequestMatcher javascript = new RequestHeaderRequestMatcher("X-Requested-With"); this.browserMatcher = new OrRequestMatcher(Arrays.asList(matcher, javascript)); }