Merge pull request #1948 from trungdlp-wolffun/feature/fire_notfound_strict_mode

Fires 404 HTTP Code when gRPC strict mode enabled
This commit is contained in:
Gerasimos (Makis) Maropoulos 2022-08-15 13:28:44 +03:00 committed by GitHub
commit 9821cbe6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,14 @@ func (g GRPC) Apply(c *ControllerActivator) {
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()
}