WebClient: return proper status code for http.MaxBytesError

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-02-27 11:03:05 +01:00
parent 874776bd12
commit 561976bcd0
5 changed files with 27 additions and 20 deletions

View File

@@ -392,6 +392,9 @@ func TestMappedStatusCode(t *testing.T) {
err = os.ErrClosed
code = getMappedStatusCode(err)
assert.Equal(t, http.StatusInternalServerError, code)
err = &http.MaxBytesError{}
code = getMappedStatusCode(err)
assert.Equal(t, http.StatusRequestEntityTooLarge, code)
}
func TestGCSWebInvalidFormFile(t *testing.T) {