Is it possible to not send any response to an incoming request using axum
?
I am trying to implement a blacklist, and while it's certainly possible to just return a 404 (you might make an argument for a different error code), if an address has earned a spot on the blacklist, I'd rather not devote the server resources or courtesy (minimal as they may be) to actually spitting out a response; I'd rather just drop the request on the floor, as it were.
The documentation mentions that errors that bubble up to the hyper
layer will cause hyper to close the connection without sending a response; it goes on to explain that this is why every single service/handler/etc. in axum
must return an Infallible
error type. While I agree that closing the connection is (in the docs' terminology) "generally not desirable", I believe that in this particular circumstance it is specifically desirable to drop the incoming request, and hope this is possible, but can't figure out how to do it.