Open tain198127 opened 3 years ago
403 forbidden is more along the lines of something spring security would handle. Route Predicates only have a true/false value currently. This would require a major modification to gateway. Marking as waiting for votes to see if anyone else would want this. If so, we'd have to weigh the cost in making a major version change for this.
Predicates are used to find the route to use. I think we should not change this and keep the Remote Addr Predicate as it is. For this problem, maybe you need a new Gateway Filter in addition (for example RemoteAddrFilter).
Is your feature request related to a problem? Please describe.
When I set RemoteAddr config in
routes.predicates,
if request was forbidden by ip, the result was not clear enough ,just show404,
but I want more clear infomation,like403
or other some info.Describe the solution you'd like I hope when request was forbidden by RemoteAddr, give a callback or some clear exception, so we can handle it.
Describe alternatives you've considered I knew io.netty.handler.ipfilter.IpFilterRuleType have another value
REJECT
, but I didn't find it in Spring Cloud Gateway, maybe could consider it in Spring Cloud Gateway.