title: Can I conditionally skip other filters in Spring Cloud Gateway?
body: <p>I set GlobalFilter whose order is -1, to check if the jwt in request header is valid.
  If not valid, I response with header which says client to redirect to login page.
  If it turns out to be invalid, there is no need to meet other filters.
  Can I temporally disable other filters in chain and directly send response?</p>
  
  <pre><code>@Order(-1)
  @Component
  public class JwtRequestFilter implements GlobalFilter {
  
      @Override
      public Mono&lt;Void&gt; filter(ServerWebExchange exchange, GatewayFilterChain chain) {
          try {
              String token = exchange.getRequest().getHeaders().get("Authorization").get(0).substring(7);
          } catch (NullPointerException e) {
              logger.warn("no token.");
              //exchange.getResponse().setStatusCode(HttpStatus.valueOf(401));
              exchange.getResponse().getHeaders().set("status", "401");
              logger.info("status code :" + exchange.getResponse().getStatusCode());
          }
          return chain.filter(exchange);
      }
  
  }
  
  </code></pre>
  
  <p>Additionally, I found that <code>exchange.getResponse().setStatusCode(HttpStatus.valueOf(401));</code> does not work but <code>exchange.getResponse().getHeaders().set("status", "401");</code> works. Why it is not changed with <code>setStatusCode</code>? I got 401 from both code when I log right after I set the status code, but using curl I always got 200.
  `</p>