Best Practices: Error Responses from Inbound filters
See original GitHub issueAre there best practices around how to respond from inbound filters. Let’s say for example, there is a inbound filter to check if a particular route exists and if not it needs to respond back with a 404. The only way to do this right now seems to be to create a new endpoint filter that’d return a 404 and then set that as the endpoint on the request context?
Isn’t there a better way to do this? Like just throw an exception with say a 404
code or something?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Inbound Filters | Sentry Documentation
Inbound data filters allow you to determine which errors, if any, Sentry should ignore. Explore these by navigating to [Project] > Project Settings...
Read more >Inbound Filters | Sentry Documentation
Inbound data filters allow you to determine which errors, if any, Sentry should ignore. Explore these by navigating to [Project] » Project Settings...
Read more >Enhanced filtering for connectors in Exchange Online
Learn how to use Enhanced Filtering for Connectors (also known as skip ... Properly configured inbound connectors are a trusted source of ...
Read more >Best Practices for Designing a Pragmatic RESTful API
Learn the best practices to make an API that is easy to adopt and pleasant ... a consumable error payload; Effectively use HTTP...
Read more >How Spam Filters Work (And How to Stop Emails Going to ...
Gmail built its brand in part on having the best spam filter that would ... to filter and quarantine both inbound and outbound...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I think I see what’s missing here. For both inbound and outbound filters, if you’re getting a body and you want to print it all out in the filter, you need to override the
needsBodyBuffered()
method and returntrue
. See parent class here: https://github.com/Netflix/zuul/blob/2.1/zuul-core/src/main/java/com/netflix/zuul/filters/BaseFilter.java#L130I’ll update the wiki to include this. Thanks for bringing it to my attention.
thanks ,@artgon no matter what content response ,the body is always null,if I have to setBody or setBodyAsText?so how can I get the body content from the original server?