Skip to content
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

Content-Type header check is case sensitive #1121

Closed
psfblair opened this issue Jun 13, 2020 · 1 comment
Closed

Content-Type header check is case sensitive #1121

psfblair opened this issue Jun 13, 2020 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@psfblair
Copy link

I was getting anomalous behavior where the Content-Type header wasn't matching; when I had the expected value as "application/json" it would tell me it was failing to match "application/json; charset=UTF-8" and when I expected the latter it would tell me it was failing to match the former. I finally discovered that there were two Content-[Tt]ype headers in the received request.

It turns out that my client was sending only one Content-type header, but that there is a case-sensitive check in PactDslRequestWithPath in the body(DslPart) method which says that if the request headers do not contain the key "Content-Type" to add it. This is a case-sensitive match and results in two headers on the request if the client is sending the header with a different case.

@uglyog uglyog added the bug Indicates an unexpected problem or unintended behavior label Jun 14, 2020
@anto-ac
Copy link
Collaborator

anto-ac commented Jun 20, 2020

Fixed in 4.1.2

@anto-ac anto-ac closed this as completed Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants