mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 17:11:37 +02: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:
@@ -76,7 +76,9 @@ func TestObjectBadRange(t *testing.T) {
|
||||
Object(w, r, o)
|
||||
resp := w.Result()
|
||||
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)
|
||||
assert.Equal(t, "Bad Request\n", string(body))
|
||||
}
|
||||
|
Reference in New Issue
Block a user