{"action":"created","issue":{"url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/6","repository_url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript","labels_url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/6/comments","events_url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/6/events","html_url":"https://github.com/YOU54F/pact-consumer-example-typescript/issues/6","id":391861916,"node_id":"MDU6SXNzdWUzOTE4NjE5MTY=","number":6,"title":"Pact-stub server is matching multiple requests where no request body is provided","user":{"login":"YOU54F","id":19932401,"node_id":"MDQ6VXNlcjE5OTMyNDAx","avatar_url":"https://avatars3.githubusercontent.com/u/19932401?v=4","gravatar_id":"","url":"https://api.github.com/users/YOU54F","html_url":"https://github.com/YOU54F","followers_url":"https://api.github.com/users/YOU54F/followers","following_url":"https://api.github.com/users/YOU54F/following{/other_user}","gists_url":"https://api.github.com/users/YOU54F/gists{/gist_id}","starred_url":"https://api.github.com/users/YOU54F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YOU54F/subscriptions","organizations_url":"https://api.github.com/users/YOU54F/orgs","repos_url":"https://api.github.com/users/YOU54F/repos","events_url":"https://api.github.com/users/YOU54F/events{/privacy}","received_events_url":"https://api.github.com/users/YOU54F/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-17T19:42:33Z","updated_at":"2019-01-02T23:34:36Z","closed_at":"2019-01-02T23:34:36Z","author_association":"OWNER","body":"# Issue\r\n\r\nWhere a pact provider is setup with the following 2 request matchers\r\n\r\n```\r\n  withRequest: {\r\n    body: requestResponse.TestRequest(\"happyPath\"),\r\n    headers: {\r\n      \"Content-Type\": \"application/json\"\r\n    },\r\n    method: \"POST\",\r\n    path: \"/test\"\r\n  }\r\n};\r\n```\r\n\r\n```\r\n  withRequest: {\r\n    body: requestResponse.TestRequest(\"\"),\r\n    headers: {\r\n      \"Content-Type\": \"application/json\"\r\n    },\r\n    method: \"POST\",\r\n    path: \"/test\"\r\n  }\r\n```\r\n\r\nWhen a request is sent with no body, a duplicate match is found and the first result is returned\r\n\r\n```sh\r\ncurl -X POST \\\r\n  http://localhost:8080/test \\\r\n  -H 'Content-Type: application/json'\r\n\r\n```\r\nPact stub server logs :- `[WARN] Found more than one pact request for method POST and path '/test', using the first one`\r\n\r\nActual Result :- Returns the first matching response (false positive)\r\nExpected Result :- Return a 404 and no body, as only a portion of the request was matched (no body)\r\n\r\n# Reproduction Steps\r\n\r\n## Versions\r\n\r\n- \"@pact-foundation/pact\": \"^7.2.0\",\r\n- pact-foundation/pact-stub-server @latest (as of 17/12/2018)\r\n\r\n## Installation\r\n\r\n- clone repository `git clone git@github.com:YOU54F/pact-consumer-example-typescript.git`\r\n- Run `yarn install`\r\n- Run `yarn build`\r\n\r\n### Run pact tests\r\n\r\n- Run `yarn run pact-test`\r\n\r\n### Start the mock server\r\n\r\n- Run `docker-compose up`\r\n\r\nRun the following request - \r\n\r\n```sh\r\ncurl -X POST \\\r\n  http://localhost:8080/test \\\r\n  -H 'Content-Type: application/json'\r\n\r\n```\r\n\r\nExpected Result = Returns an empty response body and a 404\r\nActual Result = Returns the below body and a 200\r\n\r\n```sh\r\n{\r\n    \"testResult\": \"validRequest\"\r\n}\r\n```\r\n\r\nPact stub server logs spit out the following\r\n\r\n`[WARN] Found more than one pact request for method POST and path '/test', using the first one`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/comments/451018326","html_url":"https://github.com/YOU54F/pact-consumer-example-typescript/issues/6#issuecomment-451018326","issue_url":"https://api.github.com/repos/YOU54F/pact-consumer-example-typescript/issues/6","id":451018326,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTAxODMyNg==","user":{"login":"YOU54F","id":19932401,"node_id":"MDQ6VXNlcjE5OTMyNDAx","avatar_url":"https://avatars3.githubusercontent.com/u/19932401?v=4","gravatar_id":"","url":"https://api.github.com/users/YOU54F","html_url":"https://github.com/YOU54F","followers_url":"https://api.github.com/users/YOU54F/followers","following_url":"https://api.github.com/users/YOU54F/following{/other_user}","gists_url":"https://api.github.com/users/YOU54F/gists{/gist_id}","starred_url":"https://api.github.com/users/YOU54F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YOU54F/subscriptions","organizations_url":"https://api.github.com/users/YOU54F/orgs","repos_url":"https://api.github.com/users/YOU54F/repos","events_url":"https://api.github.com/users/YOU54F/events{/privacy}","received_events_url":"https://api.github.com/users/YOU54F/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T23:34:36Z","updated_at":"2019-01-02T23:34:36Z","author_association":"OWNER","body":"This issue is resolved by switching to the ruby implementation in #10 "}}
{"actor":{"display_login":"YOU54F"}}