Skip to content

Commit ebdceda

Browse files
Add the option acceptedMethods
Add the option `acceptedMethods` to allow for requests with method other than "GET" to be processed
1 parent e0c5f11 commit ebdceda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/middleware.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module.exports = function wrapper(context) {
2424
}));
2525
}
2626

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

0 commit comments

Comments
 (0)