Parse headers in HTTPUtil without commons-httpclient 3 #542
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 344 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.350
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #542"
general
weight: 0.35
tonygermano
What
HTTPUtil.parseHeadersno longer uses commons-httpclient 3'sHttpParser. It now delegates to httpcore 4.4'sAbstractMessageParser.parseHeaders(httpcore is already on the server classpath), instead of using a custom parser.Why
This is one step toward dropping commons-httpclient 3.0.1. Following review, it uses an existing, maintained parser rather than hand-written parsing code.
Behaviour changes against httpclient 3
HTTPUtilis user-script API, so these are worth a line in the release notes. Well-formed headers (Name: valuelines separated by CRLF or LF, ending at a blank line or EOF) parse the same as before. These corner cases change:| Input | httpclient 3 | httpcore 4.4 |
|---|---|---|
| Malformed header (no colon, status line, empty name) |
org.apache.commons.httpclient.ProtocolException(anIOException),Unable to parse header: <line>|org.apache.http.ProtocolException(not anIOException),Invalid header: <line>|| Empty header name (
:v) | accepted as name""| rejected || Folded line before the first header (
orphan) | silently ignored | rejected || Whitespace-only line (
\t) | ends the header block | treated as a folded continuation, so parsing continues || Line that is only a bare CR (
\r\r\n) | ends the header block | rejected (Invalid header: [0x10]) || Folded continuation of an empty value (
X:thenb) |" b"|"b"|| Trailing whitespace on a folded line (
a,b,\tc) |"a b c"|"a b c"(only leading whitespace of each fold is dropped) || Control characters around a value (
\u000ba\u0001) | trimmed (String.trim) | kept; only spaces and tabs are trimmed || Non-ASCII on a JVM whose default charset isn't UTF-8 (e.g.
Müllerunder ISO-8859-1) | encoded with the platform charset, so mangled (M?ller) | encoded as UTF-8, so the value round-trips exactly on every platform |Reviewer notes
testNonAsciiValueno longer depends on the platform charset.MalformedInputExceptionon, for example, Java 17 on Windows.-1), matching the old unlimited behaviour.🤖 Generated with Claude Code