Skip to content

Commit

Permalink
=ht2 fix reception of unexpected mid-stream HEADERS frame with endStr…
Browse files Browse the repository at this point in the history
…eam=false
  • Loading branch information
jrudolph committed Jun 6, 2019
1 parent fec3cbe commit a56564c
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -109,9 +109,12 @@ private[http2] trait Http2StreamHandling { self: GraphStageLogic with StageLoggi

case h: ParsedHeadersFrame =>
// ignored
log.debug(s"Ignored intermediate HEADERS frame: $h")

if (h.endStream) buffer.onDataFrame(DataFrame(h.streamId, endStream = true, ByteString.empty)) // simulate end stream by empty dataframe
if (h.endStream) {
buffer.onDataFrame(DataFrame(h.streamId, endStream = true, ByteString.empty)) // simulate end stream by empty dataframe
log.debug(s"Ignored trailing HEADERS frame: $h")
} else pushGOAWAY(Http2Protocol.ErrorCode.PROTOCOL_ERROR, "Got unexpected mid-stream HEADERS frame")

maybeFinishStream(h.endStream)
}

Expand Down

0 comments on commit a56564c

Please sign in to comment.