Skip to content

Commit

Permalink
fix: socket.io had a breaking change related to cors which broken the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Jan 23, 2021
1 parent 35363e1 commit 8ee49b1
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 85 deletions.
4 changes: 2 additions & 2 deletions packages/browser-sync-ui/lib/server.js
Expand Up @@ -97,7 +97,7 @@ function insertPageMarkupFromHooks(app, pages, markup) {
if (req.url === "/" || pages[req.url.slice(1)]) {
res.writeHead(200, {"Content-Type": "text/html", "Content-Encoding": "gzip"});
if (!cached) {
var buf = new Buffer(markup, "utf-8");
var buf = Buffer.from(markup, "utf-8");
zlib.gzip(buf, function (_, result) {
cached = result;
res.end(result);
Expand Down Expand Up @@ -138,7 +138,7 @@ function serveFile(path, type, string) {
if (gzipCache[path]) {
return res.end(gzipCache[path]);
}
var buf = new Buffer(string, "utf-8");
var buf = Buffer.from(string, "utf-8");
zlib.gzip(buf, function (_, result) {
gzipCache[path] = result;
res.end(result);
Expand Down

0 comments on commit 8ee49b1

Please sign in to comment.