Overriding Zuul Filter SendErrorFilter

后端 未结 3 1552
抹茶落季
抹茶落季 2021-01-16 12:37

The class org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter handles error responses.

I would like to override this filter to do a custom response i

相关标签:
3条回答
  • 2021-01-16 13:07

    property name is changed to "zuul.SendErrorFilter.error.disable"

    0 讨论(0)
  • 2021-01-16 13:08

    You will need to disable a default SendErrorFilter by adding zuul.SendErrorFilter.post.disable: true to your application.properties. After this you can create your own.

    0 讨论(0)
  • 2021-01-16 13:10

    all you need to do is create a ZuulFilter and expose it as an @Bean. It needs to be in order before SendErrorFilter which is set to 0. You might need to remove "error.status_code" from the RequestContext so SendErrorFilter doesn't run.

    0 讨论(0)
提交回复
热议问题