unmatched_route

Function unmatched_route 

Source
pub async fn unmatched_route(headers: HeaderMap) -> Response<Body>
Expand description

Answers a request that matched no route, in the protocol the caller used.

gRPC callers get the UNIMPLEMENTED status they expect, and everyone else gets a plain 404 Not Found.

Answering a gRPC caller with a bare 404 would mostly work – the gRPC specification has clients map 404 to UNIMPLEMENTED when no grpc-status is present – but it costs nothing to return the status directly, and doing so keeps the response identical to what a standalone gRPC server would send.