Skip to content

Commit

Permalink
Merge pull request #1948 from trungdlp-wolffun/feature/fire_notfound_…
Browse files Browse the repository at this point in the history
…strict_mode

Fires 404 HTTP Code when gRPC strict mode enabled
  • Loading branch information
kataras authored Aug 15, 2022
2 parents 7bd47bf + 30e31e5 commit 9821cbe
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 9821cbe

Please sign in to comment.