Summary
Extend the H1 request parser to detect HTTP/2 Upgrade headers per RFC 7540 §3.2. The parser must identify when a client is requesting an h2c upgrade and extract the HTTP2-Settings payload.
RFC 7540 §3.2 Upgrade Request
GET / HTTP/1.1
Host: example.com
Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: <base64url encoded SETTINGS payload>
All three conditions must be met:
Upgrade: h2c header present
HTTP2-Settings header present with base64url-encoded value
Connection header includes both Upgrade and HTTP2-Settings tokens
Implementation
Files: protocol/h1/request.go, protocol/h1/parser.go
Add fields to h1.Request:
UpgradeH2C bool // true when valid h2c upgrade detected
HTTP2Settings string // raw base64url-encoded settings value
In appendHeader():
- Case-insensitively detect
upgrade header with value h2c
- Case-insensitively detect
http2-settings header, store value
- Case-insensitively detect
connection header, check for upgrade and http2-settings tokens
- Set
UpgradeH2C = true only when ALL three conditions are satisfied
In reset():
Acceptance Criteria
Summary
Extend the H1 request parser to detect HTTP/2 Upgrade headers per RFC 7540 §3.2. The parser must identify when a client is requesting an h2c upgrade and extract the HTTP2-Settings payload.
RFC 7540 §3.2 Upgrade Request
All three conditions must be met:
Upgrade: h2cheader presentHTTP2-Settingsheader present with base64url-encoded valueConnectionheader includes bothUpgradeandHTTP2-SettingstokensImplementation
Files:
protocol/h1/request.go,protocol/h1/parser.goAdd fields to
h1.Request:In
appendHeader():upgradeheader with valueh2chttp2-settingsheader, store valueconnectionheader, check forupgradeandhttp2-settingstokensUpgradeH2C = trueonly when ALL three conditions are satisfiedIn
reset():Acceptance Criteria
UpgradeH2CandHTTP2Settingsfields onh1.RequestappendHeader()handles case-insensitive matchingUpgradeH2C = truewhen all three header conditions are metreset()clears the new fields