From 717119749153bc4799a18e503efca08b39a39cfa Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Thu, 25 Apr 2019 05:30:36 +0200 Subject: [PATCH] fix(Windows): Drop Leading '\' on Windows from endpoint --- lib/controller/MockController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/controller/MockController.js b/lib/controller/MockController.js index fda1f05..0eff6c9 100644 --- a/lib/controller/MockController.js +++ b/lib/controller/MockController.js @@ -89,7 +89,7 @@ MockController.prototype = extend(MockController.prototype, { * @private */ _acceptMiddleware: function (serverOptions, responseOptions) { - var endPointId = responseOptions.dir.replace(serverOptions.dirName, '').replace(/\/$/, ''); + var endPointId = responseOptions.dir.replace(serverOptions.dirName, '').replace(/\/$/, '').replace('\\', '/'); var middleware = serverOptions.middleware; if (!endPointId || !middleware || typeof middleware[endPointId] !== 'function') {