diff --git a/lib/wsapi.js b/lib/wsapi.js index 7b12c40e6901cad3e2d60a27452a53ec9f6ef2f0..aa206d442e7c273efa70dcdf56c97ffb0bd853a4 100644 --- a/lib/wsapi.js +++ b/lib/wsapi.js @@ -327,12 +327,14 @@ exports.setup = function(options, app) { app.use(function(req, resp, next) { var purl = url.parse(req.url); - if (options.router_mode) { - // skip wsapi request, let browserid middleware handle forwards - return next(); - } else if (purl.pathname.substr(0, WSAPI_PREFIX.length) === WSAPI_PREFIX) { + if (purl.pathname.substr(0, WSAPI_PREFIX.length) === WSAPI_PREFIX) { const operation = purl.pathname.substr(WSAPI_PREFIX.length); + if (options.router_mode && -1 === forwardedOperations.indexOf(operation)) { + // skip wsapi request, let browserid middleware handle forwards + return next(); + } + // the fake_verification wsapi is implemented elsewhere. if (operation == 'fake_verification') return next();