Mismatch with header 'Accept' #1031
Please confirm the following:
When giving multiple arguments to a header, the tests should work.
When we give multiple arguments to a header, eg:
the tests fail with the following error:
which means that the headers are not handled correctly.
Steps to reproduce
The text was updated successfully, but these errors were encountered:
Thanks for this. I think it's a duplicate of #964. I've just pushed up a fix that should fix it, at least as far as we can in Pact JS.
You can now either specify headers as a comma delimited list (as you have in your repro) or explicitly as an
I've noticed a small bug with the way it reports mismatches if the request header doesn't match, but you can see what's happening in the debug logs when enabled. I'll raise an upstream issue for that.
@mefellows afair HTTP header does not have any constraints to be either a string or a comma-separated string or an array, for example, we use a JSON in a header with multiple properties, thus the object has commas. When it is sent as a string, some splitting magic happens and probably pact tries to treat broken parts of json as a separate array entries, while in reality it is a single string, but with commas.