// ErrContentLength is returned by ResponseWriter.Write calls
// when a Handler set a Content-Length response header with a
// declared size and then attempted to write more bytes than
ErrContentLength = errors.New("http: wrote more than the declared Content-Length")
Writing too many bytes to an HTTP/2 body doesn't return ErrContentLength, however, for two reasons:
The HTTP/2 ResponseWriter returns a different error when detecting a too-long body.
The accounting for how many bytes have been written can fail to detect a too-long body until after the ResponseWriter.Write call has returned.
The existing test TestIdentityResponse fails when run in HTTP/2 mode.
The text was updated successfully, but these errors were encountered: