Overriding Zuul Filter SendErrorFilter

EvilJinious1

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 instead of the ZuulException while forwarding etc.

How can I replace this with my own version? Just write and register? Would that do it or is there something else needed?

spencergibb

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related