Skip to content

Commit 7b828ec

Browse files
committed
accept protocol-relative urls
1 parent 90b10b1 commit 7b828ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

middleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ module.exports = function(compiler, options) {
106106
// publicPrefix is the folder our bundle should be in
107107
var localPrefix = options.publicPath || "/";
108108
if(url.indexOf(localPrefix) !== 0) {
109-
if(/^https?:\/\//.test(localPrefix)) {
110-
localPrefix = "/" + localPrefix.replace(/^https?:\/\/[^\/]+\//, "");
109+
if(/^(https?:)?\/\//.test(localPrefix)) {
110+
localPrefix = "/" + localPrefix.replace(/^(https?:)?\/\/[^\/]+\//, "");
111111
// fast exit if another directory requested
112112
if(url.indexOf(localPrefix) !== 0) return false;
113113
} else return false;

0 commit comments

Comments
 (0)