pact-foundation / pact-js

JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
https://pact.io
Other
1.61k stars 344 forks source link

Fix double content type header graphql #990

Closed pedrogh closed 1 year ago

pedrogh commented 1 year ago

Commit messages

PR Template

Fixes pact generated with graphql with double "Content-Type" headers

The example at pact-js/examples/graphql when running npm run test:consumer it generates a Pact file with two “Content-Type” headers. Notice how one is in lower case “c” in “content”

{
  "consumer": {
    "name": "GraphQLConsumer"
  },
  "interactions": [
    {
      "description": "a hello request",
      "request": {
        "body": {
          "operationName": "HelloQuery",
          "query": "\n          query HelloQuery {\n            hello\n          }\n        ",
          "variables": {
            "foo": "bar"
          }
        },
        "headers": {
          "Content-Type": "application/json",
          "content-type": "application/json"
        },