diff options
Diffstat (limited to 'test/middleware-mockserver.js')
-rw-r--r-- | test/middleware-mockserver.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/middleware-mockserver.js b/test/middleware-mockserver.js index 314a6d162..f6196d230 100644 --- a/test/middleware-mockserver.js +++ b/test/middleware-mockserver.js @@ -93,7 +93,9 @@ var mocks = { }, jsonp: function( req, resp, next ) { var callback; - if ( req.query.callback ) { + if ( Array.isArray( req.query.callback ) ) { + callback = Promise.resolve( req.query.callback[ req.query.callback.length - 1 ] ); + } else if ( req.query.callback ) { callback = Promise.resolve( req.query.callback ); } else if ( req.method === "GET" ) { callback = Promise.resolve( req.url.match( /^.+\/([^\/?.]+)\?.+$/ )[ 1 ] ); |