diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index b62459ee80..2068a0dc76 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -5466,6 +5466,13 @@ func (sc *http2serverConn) processHeaders(f *http2MetaHeadersFrame) error { // processing this frame. return nil } + // RFC 7540, sec 5.1: If an endpoint receives additional frames, other than + // WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in + // this state, it MUST respond with a stream error (Section 5.4.2) of + // type STREAM_CLOSED. + if st.state == http2stateHalfClosedRemote { + return http2streamError(id, http2ErrCodeStreamClosed) + } return st.processTrailerHeaders(f) }