Skip to content

chore(ffi): upgrade to pact-ffi 0.5.10 - #566

Closed
YOU54F wants to merge 2 commits into
pact-foundation:masterfrom
YOU54F:deps/pact-ffi-0.5.10
Closed

YOU54F wants to merge 2 commits into
pact-foundation:masterfrom
YOU54F:deps/pact-ffi-0.5.10

Conversation

@YOU54F

@YOU54F YOU54F commented Oct 8, 2026

Copy link
Copy Markdown
Member

Updates to the latest pact-ffi.

v0.5.x introduces the pact core mock server v2, and client behaviour has differed slightly, which shows up in pact-nets regression suite.

With libpact_ffi 0.5.x, a request header configured as separate values can mismatch
the single comma-separated value sent by an HTTP client. Clients will be expected to
configure the expected header as the joined value instead:

.WithHeader("X-Request", "request1, request2")

This replaces separate calls such as .WithHeader("X-Request", "request1") and
.WithHeader("X-Request", "request2") when those values are sent together in one
request header.

such as

.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")

This is going to change client behaviour so will be a breaking change.

According to RFC 7230,

A sender MUST NOT generate multiple header fields with the same field
name in a message unless either the entire field value for that
header field is defined as a comma-separated list [i.e., #(values)]
or the header field is a well-known exception (as noted below).

The only valid exception is Set-Cookie

So the client is expected to fold up multiple headers into a single comma separated string, so one could argue this change is correct, and correcting a previous bug. If the client was sending two headers of the same name, with a different value, they would not be honouring the above RFC

Not sure what this means for versioning here, minor or major.

@mefellows

Copy link
Copy Markdown
Member

I wonder if we could change the mock server behaviour under the hood. i.e. if the function was called multiple times like this:

.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")

It would be the equivalent of sending a .WithHeader("X-Request", "request1, request2")?

@YOU54F

YOU54F commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

I wonder if we could change the mock server behaviour under the hood. i.e. if the function was called multiple times like this:

.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")

It would be the equivalent of sending a .WithHeader("X-Request", "request1, request2")?

Yes that is probably a nice way to avoid a public facing change in the dsl, but there will still be a change in the resulting pact file

@YOU54F

YOU54F commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

Okay so think I have solved in pact matching - pact-foundation/pact-reference#568, with a repro in pact core mock server - pact-foundation/pact-core-mock-server#16

The tested library resulted in no end user dsl or pact changes #569

@YOU54F YOU54F closed this Oct 16, 2026
@YOU54F YOU54F mentioned this pull request Nov 19, 2026
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.

2 participants