Skip to content

Commit 587baf8

Browse files
fix: security problem with sockjs
1 parent 90488f1 commit 587baf8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/Server.js

Lines changed: 1 addition & 4 deletions
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

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)