httputil: ignore errors < 400 (#3781)

This commit is contained in:
Caleb Doxsey 2022-12-05 09:00:25 -07:00 committed by GitHub
parent 090601873f
commit a5082f60e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -21,6 +21,7 @@ func TestHTTPError_ErrorResponse(t *testing.T) {
}{
{"404 json", http.StatusNotFound, errors.New("route not known"), "application/json", http.StatusNotFound, "{\"Status\":404}\n"},
{"404 html", http.StatusNotFound, errors.New("route not known"), "", http.StatusNotFound, ""},
{"302 found", http.StatusFound, errors.New("redirect"), "", http.StatusFound, ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {