http3: set ContentLength to -1 if no Content-Length header is set (#4645)

This applies to both the http.Response and the http.Request.
This commit is contained in:
Marten Seemann
2024-08-30 20:28:06 +08:00
committed by GitHub
parent 229937c503
commit 7c3544ca34
4 changed files with 15 additions and 7 deletions

View File

@@ -289,6 +289,7 @@ var _ = Describe("HTTP tests", func() {
Expect(resp.StatusCode).To(Equal(200))
body, err := io.ReadAll(gbytes.TimeoutReader(resp.Body, 20*time.Second))
Expect(err).ToNot(HaveOccurred())
Expect(resp.ContentLength).To(BeEquivalentTo(-1))
Expect(body).To(Equal(PRDataLong))
})