Skip to content

Commit 15f7d40

Browse files
committed
http2: correctly wrap ErrFrameTooLarge in Framer.ReadFrame
In Framer.ReadFrame's frame-too-large check, the code that checks for HTTP/1.1 looking frames accidentally wrapped the unrelated err from the previous readFrameHeader call instead of ErrFrameTooLarge. Fix that. Change-Id: I2237759eaad8c6e06e7195c50410abb5792e57ea Reviewed-on: https://go-review.googlesource.com/c/net/+/676218 Reviewed-by: Chressie Himpel <[email protected]> Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent ef33bc0 commit 15f7d40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http2/frame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func (fr *Framer) ReadFrame() (Frame, error) {
509509
}
510510
if fh.Length > fr.maxReadSize {
511511
if fh == invalidHTTP1LookingFrameHeader() {
512-
return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err)
512+
return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge)
513513
}
514514
return nil, ErrFrameTooLarge
515515
}

0 commit comments

Comments
 (0)