Skip to content

Commit

Permalink
Fires 404 HTTP Code when use gRPC strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
trungdlp-wolffun committed Aug 9, 2022
1 parent 028ee70 commit 30e31e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mvc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 30e31e5

Please sign in to comment.