fix: address overlooked nil check for MaxBytesError

This commit is contained in:
Rishita Shaw 2024-11-22 22:39:22 +05:30
parent c9a4a20141
commit 42a3c0c4c9

View File

@ -94,10 +94,8 @@ type errorWrapper struct {
func (ew errorWrapper) Read(p []byte) (n int, err error) {
n, err = ew.ReadCloser.Read(p)
if err != nil {
if _, ok := err.(*http.MaxBytesError); ok {
err = caddyhttp.Error(http.StatusRequestEntityTooLarge, err)
}
if _, ok := err.(*http.MaxBytesError); ok {
err = caddyhttp.Error(http.StatusRequestEntityTooLarge, err)
}
return
}