Fires 404 HTTP Code when use gRPC strict mode

This commit is contained in:
Phước Trung 2022-08-09 16:37:29 +07:00
parent 028ee70d4a
commit 30e31e546f

View File

@ -47,7 +47,14 @@ func (g GRPC) Apply(c *ControllerActivator) {
return return
} }
// If strict was false, allow common HTTP clients, consumes and produces JSON. // If strict was true fires 404 on common HTTP clients.
if g.Strict {
ctx.NotFound()
ctx.StopExecution()
return
}
// Allow common HTTP clients, consumes and produces JSON.
ctx.Next() ctx.Next()
} }