Add configurable request header size to the HTTP Listener #393
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.73) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 565 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.379
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #393"
general
weight: 0.35
pacmano1
Closes #392.
Jetty caps the combined size of all request headers at 8192 bytes and answers anything larger with
431 Request Header Fields Too Largeduring header parsing, so the channel never sees the request. This adds a per-connector Request Header Size field.The value is a String and resolves through the template replacer at channel start, like
host,portandtimeoutalready do.Invalid values fail the connector
Addressing @mgaffigan's review. A value that does not resolve to a positive number now fails the connector at start rather than falling back to 8192:
Falling back was a silent loss of the limit. Someone setting a cap lower than the default, to bound memory use or to stay within what a downstream component expects, would have had the higher default quietly restored.
Passing
0as theNumberUtilsdefault is what makes this one branch instead of two. An unparseable value, an unresolved template, zero and a negative all land on 0 and fail the same way, and the message carries the value as it resolved, so a broken substitution shows up as the literal${...}text rather than a number.Only
requestHeaderSizechanged. The pre-existingport,timeoutandresponseStatusCodefallbacks in this file have live channels behind them, so tightening those is a separate change.Addressing @tonygermano's review, the Jetty
HttpConfigurationis now built in aprotected createHttpConfig(HttpReceiver)rather than inline inconfigureReceiver. An implementation that overridesconfigureReceivercan build its listener from the current defaults instead of repeating them, and picks up later additions for free. No behaviour change.TLSHttpConfigurationin the NovaMap TLS manager plugin extends this class and is the case in point: its non-TLS branch already delegates tosuperand gets the setting, while its TLS branch repeats two of the settings and misses the header size. Raised there as tls-manager-plugin#44; TLS listeners keep ignoring the setting until that lands.Existing channels
Nothing happens to them on upgrade. A channel saved before this feature has no
requestHeaderSizeelement, and XStream leaves the field null when it loads one, sogetRequestHeaderSize()returns 8192 and the channel deploys and runs exactly as it did before. No migration runs and no stored channel is modified.Open such a channel in the editor and the field shows 8192. That is the getter's answer rather than something read from the channel, so the element is only written the first time someone saves it. Until then an export of that channel still has no element.
The strict check only applies to a value that is actually present, so an absent one can never fail a deploy.
How to verify
Run on a live engine, HTTP Listener on port 9000, context path
/test.| configured value | result |
|---|---|
|
10000| starts; 9945-byte header returns 200, 9950-byte returns 431 ||
${headerSize}with$gc('headerSize','10000')in the deploy script | starts; same 9945/9950 boundary, so the resolved value applied rather than the default ||
0pushed via the REST API | channel STOPPED,ConnectorTaskException: Invalid request header size: 0||
${headerSize}with the deploy script cleared | channel STOPPED,ConnectorTaskException: Invalid request header size: ${headerSize}|| element stripped from the channel XML entirely | starts on 8192, boundary drops accordingly |
The ~55-byte gap between the configured value and the observed boundary is the request line plus
Host,User-AgentandAccept.The last three cannot be reached through the connector panel, which rejects them, so they were pushed through the REST API the way an import or an API-created channel would arrive.
Tests
12 across three classes: a real Jetty connector for 431 versus 200, a real receiver covering the resolution path including zero, negative, unparseable and an unresolved template, and a serialized-XML round trip proving a channel with no element still gets 8192. Removing the throw fails four tests; changing the default constant fails a third class.