Skip to content

Custom headers containing commas are incorrectly split (pact-js#1058) #516

@mefellows

Description

@mefellows

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions