-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mismatch with header 'Accept' #1031
Comments
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. |
Hi @mefellows , |
@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. |
You're right, it is a bug - thanks for raising it. I'll need to review the RFC and the current core implementation to think of the best way to handle this. |
Software versions
Issue Checklist
Please confirm the following:
Expected behavior
When giving multiple arguments to a header, the tests should work.
Actual behavior
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: