mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-26 04:57:50 +00:00
Motivation: RFC 7540 is not particularly clear on whether the server is required to send PUSH_PROMISE frames before or after the HEADERS frame, or whether both are acceptable. We took a somewhat hard-line approach by asserting that PUSH_PROMISE could only be sent after the server sent HEADERS, but we've now caught at least one notable implementation in the wild doing something different (nghttp2). Given that there's no clear normative language pointing in either direction, we should consider being a bit more lenient and allowing both. Modifications: - Updated the stream state machine to allow pushes on a locally-idle stream. Result: Servers can send PUSH_PROMISE before they have sent HEADERS.