Skip to content

Commit

Permalink
Add the option acceptedMethods
Browse files Browse the repository at this point in the history
Add the option `acceptedMethods` to allow for requests with method other than "GET" to be processed
  • Loading branch information
ferdinando-ferreira committed Aug 20, 2018
1 parent e0c5f11 commit ebdceda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = function wrapper(context) {
}));
}

if (req.method !== 'GET') {
const acceptedMethods = context.options.acceptedMethods || ['GET'];
if (acceptedMethods.indexOf(req.method) === -1) {
return goNext();
}

Expand Down

0 comments on commit ebdceda

Please sign in to comment.