Skip to content

Commit d703a85

Browse files
inteonsbueringer
andauthored
Make error status code more precise.
Co-authored-by: Stefan Büringer <4662360+sbueringer@users.noreply.github.com>
1 parent 9dcfc53 commit d703a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/webhook/admission/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request) {
8383
if limitedReader.N <= 0 {
8484
err := fmt.Errorf("request entity is too large; limit is %d bytes", maxRequestSize)
8585
wh.getLogger(nil).Error(err, "unable to read the body from the incoming request; limit reached")
86-
wh.writeResponse(w, Errored(http.StatusBadRequest, err))
86+
wh.writeResponse(w, Errored(http.StatusRequestEntityTooLarge, err))
8787
return
8888
}
8989

0 commit comments

Comments
 (0)