Skip to content

Commit

Permalink
Make error status code more precise.
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Büringer <4662360+sbueringer@users.noreply.github.com>
  • Loading branch information
inteon and sbueringer committed Dec 21, 2023
1 parent 9dcfc53 commit d703a85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/webhook/admission/http.go
Expand Up @@ -83,7 +83,7 @@ func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if limitedReader.N <= 0 {
err := fmt.Errorf("request entity is too large; limit is %d bytes", maxRequestSize)
wh.getLogger(nil).Error(err, "unable to read the body from the incoming request; limit reached")
wh.writeResponse(w, Errored(http.StatusBadRequest, err))
wh.writeResponse(w, Errored(http.StatusRequestEntityTooLarge, err))
return
}

Expand Down

0 comments on commit d703a85

Please sign in to comment.