diff --git a/core/server/middleware/static-theme.js b/core/server/middleware/static-theme.js index bfa3a06959..e48fe3dad3 100644 --- a/core/server/middleware/static-theme.js +++ b/core/server/middleware/static-theme.js @@ -23,7 +23,7 @@ function forwardToExpressStatic(req, res, next) { function staticTheme() { return function blackListStatic(req, res, next) { - if (isBlackListedFileType(req.url)) { + if (isBlackListedFileType(req.path)) { return next(); } return forwardToExpressStatic(req, res, next); diff --git a/core/test/unit/middleware/static-theme_spec.js b/core/test/unit/middleware/static-theme_spec.js index e676fed83b..66df75ed40 100644 --- a/core/test/unit/middleware/static-theme_spec.js +++ b/core/test/unit/middleware/static-theme_spec.js @@ -14,7 +14,7 @@ describe('staticTheme', function () { it('should call next if hbs file type', function () { var req = { - url: 'mytemplate.hbs' + path: 'mytemplate.hbs' }; staticTheme(null)(req, null, next); @@ -23,7 +23,7 @@ describe('staticTheme', function () { it('should call next if md file type', function () { var req = { - url: 'README.md' + path: 'README.md' }; staticTheme(null)(req, null, next); @@ -32,7 +32,7 @@ describe('staticTheme', function () { it('should call next if json file type', function () { var req = { - url: 'sample.json' + path: 'sample.json' }; staticTheme(null)(req, null, next); @@ -41,7 +41,7 @@ describe('staticTheme', function () { it('should call express.static if valid file type', function (done) { var req = { - url: 'myvalidfile.css', + path: 'myvalidfile.css', app: { get: function () { return 'casper'; } } @@ -65,7 +65,7 @@ describe('staticTheme', function () { it('should not error if active theme is missing', function (done) { var req = { - url: 'myvalidfile.css', + path: 'myvalidfile.css', app: { get: function () { return undefined; } }