title: URL Pattern filtering in Spring Webflux WebFilterChain
body: <p>I am trying to write a filter in Spring Webflux, but am unable to find an option to apply the filter only to certain URL patterns. In the Spring MVC world, this can be achieved using</p>
  
  <pre><code>FilterRegistrationBean.addUrlPatterns("/protected/*");
  </code></pre>
  
  <p>But I am unable to find an equivalent for it in the webflux world.</p>
  
  <p>As a workaround, I am using the following, but it obviously is not the right way to do it</p>
  
  <pre><code>String path = serverWebExchange.getRequest().getURI().getPath();
  if(path.contains("/protected/"))
  &lt;do-something&gt;
  </code></pre>
  
  <p>Is there any Spring Webflux native URL pattern matching method in <code>WebFilterChain</code> that I can use to apply the filter to only a specific set of URLs ? Thanks !</p>