Example usage for org.springframework.security.web.server.util.matcher MediaTypeServerWebExchangeMatcher setIgnoredMediaTypes

List of usage examples for org.springframework.security.web.server.util.matcher MediaTypeServerWebExchangeMatcher setIgnoredMediaTypes

Introduction

In this page you can find the example usage for org.springframework.security.web.server.util.matcher MediaTypeServerWebExchangeMatcher setIgnoredMediaTypes.

Prototype

public void setIgnoredMediaTypes(Set<MediaType> ignoredMediaTypes) 

Source Link

Document

Set the MediaType to ignore from the ContentNegotiationStrategy .

Usage

From source file:org.springframework.security.web.server.savedrequest.WebSessionServerRequestCache.java

private static ServerWebExchangeMatcher createDefaultRequestMacher() {
    ServerWebExchangeMatcher get = ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/**");
    ServerWebExchangeMatcher notFavicon = new NegatedServerWebExchangeMatcher(
            ServerWebExchangeMatchers.pathMatchers("/favicon.*"));
    MediaTypeServerWebExchangeMatcher html = new MediaTypeServerWebExchangeMatcher(MediaType.TEXT_HTML);
    html.setIgnoredMediaTypes(Collections.singleton(MediaType.ALL));
    return new AndServerWebExchangeMatcher(get, notFavicon, html);
}