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

Allow possibility of not setting the response['headers']['Content-Type'] in contracts #460

Open
kga20 opened this issue Aug 14, 2024 · 0 comments

Comments

@kga20
Copy link

kga20 commented Aug 14, 2024

Expected - when creating contracts, we should be able to not set the response['headers']['Content-Type'] and it shouldn't be defaulted to 'application/json'

Actual - Even when we don't specify .withResponseHeaders() function, the contract has
"response": {
"headers": {
"Content-Type": [
"application/json;charset=UTF-8"
]
},

Steps:
We use pact for c++ api to write our contracts ..
sample code for generating contract
m_pact.given("some provider state")
.uponReceiving("a request to xxx")
.withRequest("POST", "/abc")
.withJsonBody(requestMatcher)
.willRespondWith(200)
.withResponseJsonBody(responseMatcher);

We expect this not to set a default response['headers']['Content-Type']
and we should explicitly be setting it ..

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

No branches or pull requests

1 participant