Skip to content

Commit a7f7fe1

Browse files
committed
Fix invalid invocation in filename resolver.
1 parent ae0b1e5 commit a7f7fe1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

middleware.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module.exports = function(compiler, options) {
111111
localPrefix = "/" + localPrefix.replace(/^https?:\/\/[^\/]+\//, "");
112112
}
113113
// fast exit if another directory requested
114-
if(url.indexOf(localPrefix) != 0) return next();
114+
if(url.indexOf(localPrefix) != 0) return false;
115115
// get filename from request
116116
var filename = url.substr(localPrefix.length);
117117
return pathJoin(compiler.outputPath, filename);
@@ -120,6 +120,8 @@ module.exports = function(compiler, options) {
120120
// The middleware function
121121
function webpackDevMiddleware(req, res, next) {
122122
var filename = getFilenameFromUrl(req.url);
123+
if (filename === false) return next();
124+
123125
// in lazy mode, rebuild on bundle request
124126
if(options.lazy && filename === pathJoin(compiler.outputPath, options.filename))
125127
rebuild();
@@ -154,4 +156,4 @@ module.exports = function(compiler, options) {
154156
webpackDevMiddleware.fileSystem = fs;
155157

156158
return webpackDevMiddleware;
157-
}
159+
}

0 commit comments

Comments
 (0)