RFC 7540 say below in 5.3.1 Stream Dependencies
A stream cannot depend on itself. An endpoint MUST treat this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR.
Stream Priority Feature is not implemented yet. (
But we must add error handling for this.
h2spec tests this.
5.3. Stream Priority
5.3.1. Stream Dependencies
× Sends HEADERS frame that depend on itself
- The endpoint MUST treat this as a stream error of type PROTOCOL_ERROR
Expected: GOAWAY frame (ErrorCode: PROTOCOL_ERROR)
RST_STREAM frame (ErrorCode: PROTOCOL_ERROR)
Actual: DATA frame (Length: 5895, Flags: 1)