Skip to content

Commit 0ae759a

Browse files
authored
Merge pull request #1227 from yanwsh/master
Fix custom middleware not working on proxy mode
2 parents 41cbd42 + 133a498 commit 0ae759a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/browser-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ BrowserSync.prototype.addMiddleware = function (route, handle, opts) {
424424
}
425425

426426
bs.options = bs.options.update("middleware", function (mw) {
427-
return mw.concat(entry);
427+
return (bs.options.get("mode") === "proxy")? mw.insert(mw.size-1, entry) : mw.concat(entry);
428428
});
429429

430430
bs.resetMiddlewareStack();

0 commit comments

Comments
 (0)