Skip to content

Commit

Permalink
fix: include headers on interactions requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Jul 12, 2022
1 parent 84b5cdd commit 1014bc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pactflow/pact-msw-adapter",
"name": "@s-ui/pact-msw-adapter",
"version": "1.2.0",
"main": "./dist/pactMswAdapter.js",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/convertMswMatchToPact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const convertMswMatchToPact = ({
method: match.request.method,
path: match.request.url.pathname,
headers: headers?.excludeHeaders
? omit(match.request.headers['_headers'], headers.excludeHeaders)
: match.request.headers['_headers'],
? omit(Object.fromEntries(match.request.headers.entries()), headers.excludeHeaders)
: Object.fromEntries(match.request.headers.entries()),
body: match.request.body || undefined,
query: match.request.url.search ? match.request.url.search.split('?')[1] : undefined
},
Expand Down

0 comments on commit 1014bc2

Please sign in to comment.