Skip to content

Commit 27c6515

Browse files
Potential fix for code scanning alert no. 30: Log injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 849f201 commit 27c6515

File tree

1 file changed

+2
-1
lines changed
  • other/ton-telegram-example/server/api

1 file changed

+2
-1
lines changed

other/ton-telegram-example/server/api/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ app.post("/auth/telegram", async (req, res) => {
6969

7070
const sanitizedInitDataRaw = initDataRaw ? initDataRaw.replace(/\n|\r/g, "") : initDataRaw;
7171
console.log("Received initDataRaw (sanitized):", sanitizedInitDataRaw);
72-
console.log("isMocked:", isMocked);
72+
const sanitizedIsMocked = Boolean(isMocked);
73+
console.log("isMocked (sanitized):", sanitizedIsMocked);
7374
const sanitizedPhotoUrl = photoUrl ? photoUrl.replace(/\n|\r/g, "") : photoUrl;
7475
console.log("photoUrl (sanitized):", sanitizedPhotoUrl); // Log the sanitized photoUrl for debugging
7576

0 commit comments

Comments
 (0)