Skip to content

Commit f98578f

Browse files
fix(mcp): improve log sanitization by replacing control characters with spaces
1 parent 2fb31ec commit f98578f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/niftycli-mcp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { startServer } from "../src/mcp/server.js";
33

44
function sanitizeForLog(text) {
5-
return String(text).replace(/[\x00-\x1f]+/g, " ");
5+
return Array.from(String(text), (ch) => (ch.charCodeAt(0) < 0x20 ? " " : ch)).join("");
66
}
77

88
try {

0 commit comments

Comments
 (0)