mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 10:23:16 +08:00
lib/http: fix tests after go1.23 update
go1.22 output the Content-Length on a bad Range request on a file but go1.23 doesn't - adapt the tests accordingly.
This commit is contained in:
parent
3b51ad24b2
commit
d149d1ec3e
|
@ -76,7 +76,9 @@ func TestObjectBadRange(t *testing.T) {
|
||||||
Object(w, r, o)
|
Object(w, r, o)
|
||||||
resp := w.Result()
|
resp := w.Result()
|
||||||
assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
|
assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
|
||||||
assert.Equal(t, "10", resp.Header.Get("Content-Length"))
|
if contentLength := resp.Header.Get("Content-Length"); contentLength != "" {
|
||||||
|
assert.Equal(t, "10", contentLength)
|
||||||
|
}
|
||||||
body, _ := io.ReadAll(resp.Body)
|
body, _ := io.ReadAll(resp.Body)
|
||||||
assert.Equal(t, "Bad Request\n", string(body))
|
assert.Equal(t, "Bad Request\n", string(body))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user