Live2d Test Env

SpringCloudGateway内置GatewayFilter工厂类之Redirect类过滤器(六)

1、RedirectTo

  RedirectTo GatewayFilter Factory采用status和url参数。 状态应该是300系列重定向http代码,例如301. url应该是有效的URL。 这将是Location标头的值。

  eg:

spring:
  cloud:
    gateway:
      routes:
      - id: prefixpath_route
        uri: http://example.org
        filters:
        - RedirectTo=302, http://acme.org

将发送带有Location:http://acme.org 的请求头属性且状态302的请求,以执行重定向。

 

posted @ 2021-11-26 13:59  红尘中人·杨哥  阅读(635)  评论(0编辑  收藏  举报