Summary
The parse_header function in pact_models/src/headers.rs incorrectly splits all unknown headers by comma. Custom headers containing JSON or other comma-separated data are broken into invalid fragments, causing verification failures.
Reproduction
Branch with reproduction tests: repro/issue-header-comma-split
Root Cause
In pact_models/src/headers.rs:30-33 - the logic is inverted:
- Current: Split everything except known single-value headers
- Should be: Split only known multi-value headers
Suggested Fix
Use MULTI_VALUE_HEADERS allowlist instead of SINGLE_VALUE_HEADERS blocklist, following the JVM implementation.
Related
Summary
The
parse_headerfunction inpact_models/src/headers.rsincorrectly splits all unknown headers by comma. Custom headers containing JSON or other comma-separated data are broken into invalid fragments, causing verification failures.Reproduction
Branch with reproduction tests:
repro/issue-header-comma-splitRoot Cause
In
pact_models/src/headers.rs:30-33- the logic is inverted:Suggested Fix
Use
MULTI_VALUE_HEADERSallowlist instead ofSINGLE_VALUE_HEADERSblocklist, following the JVM implementation.Related