Skip to content

Commit 586319c

Browse files
committed
fix: update restana methods API compatibility
The newer version of restana changed its export structure. The require('restana/libs/methods') now returns a function with a .BASE property containing the HTTP methods array, rather than directly exporting the array. Fixes test failures with: TypeError: require(...).filter is not a function
1 parent bd0cca3 commit 586319c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const defaultProxyFactory = require('./lib/proxy-factory')
66
const restana = require('restana')
77
const defaultProxyHandler = (req, res, url, proxy, proxyOpts) =>
88
proxy(req, res, url, proxyOpts)
9-
const DEFAULT_METHODS = require('restana/libs/methods').filter(
9+
const DEFAULT_METHODS = require('restana/libs/methods').BASE.filter(
1010
(method) => method !== 'all'
1111
)
1212
const NOOP = (req, res) => {}

0 commit comments

Comments
 (0)