Skip to content

Commit

Permalink
fix: avoid creation unnnecessary stream for static sockjs file (#4482)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Jun 13, 2022
1 parent abed4fd commit 049b153
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1964,12 +1964,9 @@ class Server {
(req, res) => {
res.setHeader("Content-Type", "application/javascript");

const { createReadStream } = fs;
const clientPath = path.join(__dirname, "..", "client");

createReadStream(
path.join(clientPath, "modules/sockjs-client/index.js")
).pipe(res);
res.sendFile(path.join(clientPath, "modules/sockjs-client/index.js"));
}
);

Expand Down

0 comments on commit 049b153

Please sign in to comment.