Skip to content

Commit 133a498

Browse files
authored
Update browser-sync.js
bug fix, custom middleware not working on proxy mode.
1 parent 41cbd42 commit 133a498

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)