Skip to content

Commit 049b153

Browse files
fix: avoid creation unnnecessary stream for static sockjs file (#4482)
1 parent abed4fd commit 049b153

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/Server.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1964,12 +1964,9 @@ class Server {
19641964
(req, res) => {
19651965
res.setHeader("Content-Type", "application/javascript");
19661966

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

1970-
createReadStream(
1971-
path.join(clientPath, "modules/sockjs-client/index.js")
1972-
).pipe(res);
1969+
res.sendFile(path.join(clientPath, "modules/sockjs-client/index.js"));
19731970
}
19741971
);
19751972

0 commit comments

Comments
 (0)