Skip to content

Commit

Permalink
[internal-branch.go1.21-vendor] http2: reject DATA frames after 1xx a…
Browse files Browse the repository at this point in the history
…nd before final headers

When checking to see if a DATA frame can be accepted, check to
see if we have received a non-1xx header, not whether we have
received any header.

For golang/go#65927
Fixes golang/go#66254

Change-Id: Id4fae1862de6179f8fc95e02dec7d4c47a7640e1
Reviewed-on: https://go-review.googlesource.com/c/net/+/567175
Reviewed-by: Jonathan Amsterdam <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-on: https://go-review.googlesource.com/c/net/+/574855
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
neild authored and gopherbot committed Mar 27, 2024
1 parent 5ca955b commit 1a2eef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
})
return nil
}
if !cs.firstByte {
if !cs.pastHeaders {
cc.logf("protocol error: received DATA before a HEADERS frame")
rl.endStreamError(cs, StreamError{
StreamID: f.StreamID,
Expand Down

0 comments on commit 1a2eef3

Please sign in to comment.