Skip to content

Commit

Permalink
fix(@whook/http-router): Use bodySpecs everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Jul 19, 2019
1 parent 8181a0b commit 422b97d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/whook-http-router/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ async function initHTTPRouter({

applyValidators(operation, validators, parameters);

bodyValidator(operation, request.headers['content-type'], body);
bodyValidator(operation, bodySpec.contentType, body);

parameters = {
...parameters,
Expand Down
4 changes: 2 additions & 2 deletions packages/whook-http-router/src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ describe('initHTTPRouter', () => {
req.method = 'PUT';
req.url = '/v1/users/1';
req.headers = {
'content-type': 'application/json',
'content-type': 'application/json;charset=UTF-8',
'content-length': '22',
authorization: 'Bearer x',
};
Expand Down Expand Up @@ -1661,7 +1661,7 @@ describe('initHTTPRouter', () => {
name: 'John Doe',
},
authorization: 'Bearer x',
contentType: 'application/json',
contentType: 'application/json;charset=UTF-8',
});
});

Expand Down

0 comments on commit 422b97d

Please sign in to comment.