Skip to content

Commit

Permalink
fix security vuln (#1794)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMoorJasper authored and devongovett committed Sep 25, 2018
1 parent 948159b commit 066e0bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/core/parcel-bundler/src/HMRServer.js
Expand Up @@ -17,7 +17,17 @@ class HMRServer {
this.server = https.createServer(await getCertificate(options.https));
}

this.wss = new WebSocket.Server({server: this.server});
let websocketOptions = {
server: this.server
};

if (options.hmrHostname) {
websocketOptions.origin = `${options.https ? 'https' : 'http'}://${
options.hmrHostname
}`;
}

this.wss = new WebSocket.Server(websocketOptions);
this.server.listen(options.hmrPort, resolve);
});

Expand Down

0 comments on commit 066e0bf

Please sign in to comment.