Skip to content

feat: support repeated headers per RFC 9110 §5.3 - #51

Draft
YOU54F wants to merge 4 commits into
masterfrom
fix/repeated-headers-rfc9110
Draft

YOU54F wants to merge 4 commits into
masterfrom
fix/repeated-headers-rfc9110

Conversation

@YOU54F

@YOU54F YOU54F commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • withRequestHeader / withResponseHeader take a value index and call pactffi_with_header_v2, so each value of a repeated header (RFC 9110 §5.3) can carry its own matcher.
  • Mock server logs can be read in-process: logToBuffer() sends the native core logs to an in-memory buffer, fetchLogBuffer() reads the global buffer, and ConsumerPact.mockServerLogs(port) reads a mock server's logs (before cleanupMockServer). That lets tests assert the chore(deps): update dependency node-addon-api to v8 - autoclosed pact-foundation/pact-js-core#584 deprecation warning.
  • pactffiFetchLogBuffer now takes an optional string log id and returns string | null, which matches the FFI signature.
  • New test: test/repeated-headers.integration.spec.ts (H1–H8b repeated request and response header cases).

Test results (pact_ffi from pact-foundation#584)

101 pass, 1 skipped. Against released pact_ffi the repeated-header cases that depend on pact-foundation#584 fail (expected).

Release notes

  • New exports logToBuffer and fetchLogBuffer, and ConsumerPact.mockServerLogs.
  • pactffiFetchLogBuffer's type changed (logId?: string, returns string | null).

Depends on

Draft until pact-foundation#584 is released and the FFI version here is bumped.

Known upstream issue

Per-index header matchers work in the mock server but collapse to a single, randomly chosen rule when the pact file is written (pact_models to_v3_json drops the index). This predates pact-foundation#584; draft fix in YOU54F/pact-reference#15.

🤖 Generated with Claude Code

Adds withRequestHeader/withResponseHeader index support via
pactffi_with_header_v2 so each value of a repeated header (RFC 9110 §5.3)
can carry its own matcher, with integration tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YOU54F and others added 3 commits November 9, 2026 17:24
…evert before merge)

Points download-ffi.sh at the YOU54F/pact-reference fork prerelease
(overridable with PACT_FFI_BASEURL), bumps PACT_FFI_VERSION to
0.5.13-rc.1, and forces the prebuild path in CI (as if the PR title
contained "(rebuild)") so the native addon is built against the rc
instead of fetching published prebuilds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… longer matches)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant