Package dev.relism.flash.http2.frame
Class FrameValidator
java.lang.Object
dev.relism.flash.http2.frame.FrameValidator
Table-driven RFC 9113 per-frame-type validation: length bounds, the stream-id
required/forbidden/either rule, and the two special-cased structural rules (
SETTINGS'
multiple-of-6 length, PUSH_PROMISE always rejected from a client) that do not fit a
class is the code that reads it.
The error code is not uniform — read the RFC per violation, not just per type. A
SETTINGS frame with a bad length is FRAME_SIZE_ERROR; the same frame with a
non-zero stream id is PROTOCOL_ERROR. This class throws the specific code each
violation's own RFC citation requires, not a single blanket code per type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidvalidate(FrameHeader header, boolean insideHeaderBlock) Validatesheaderagainst RFC 9113's rules for its type.
-
Method Details
-
validate
Validatesheaderagainst RFC 9113's rules for its type.- Parameters:
insideHeaderBlock- whether this frame arrived between a HEADERS/PUSH_PROMISE frame lackingEND_HEADERSand its terminating CONTINUATION — changes the handling of an unrecognised type (§6.10: aPROTOCOL_ERROR, not the usual silent ignore, since an in-progress header block cannot tolerate an interloper frame of any kind without desynchronizing HPACK's stateful decode)- Throws:
Http2Exception- on any RFC violation, with the specific error code the violated rule mandates
-