mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
Compare commits
2 Commits
fix-quickc
...
codeql-fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c0ed076d5 | ||
|
|
118c24ee05 |
1
.github/workflows/notification.yml
vendored
1
.github/workflows/notification.yml
vendored
@@ -1,4 +1,5 @@
|
||||
name: 🛎️ Discord Notification
|
||||
permissions: {}
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
@@ -96,7 +96,9 @@ export const useWebSocket = ({
|
||||
| Record<string, string>
|
||||
| undefined; // Arguments are Dictionary<string, string>
|
||||
|
||||
console.log("[WS] ~ ", lastMessage);
|
||||
// Sanitize output to avoid log injection
|
||||
const msgStr = JSON.stringify(lastMessage).replaceAll(/[\n\r]/g, " ");
|
||||
console.log("[WS] ~ %s", msgStr);
|
||||
|
||||
if (command === "PlayPause") {
|
||||
console.log("Command ~ PlayPause");
|
||||
|
||||
@@ -96,7 +96,9 @@ export const WebSocketProvider = ({ children }: WebSocketProviderProps) => {
|
||||
newWebSocket.onmessage = (e) => {
|
||||
try {
|
||||
const message = JSON.parse(e.data);
|
||||
console.log("[WS] Received message:", message);
|
||||
// Sanitize output to avoid log injection
|
||||
const msgStr = JSON.stringify(message).replaceAll(/[\n\r]/g, " ");
|
||||
console.log("[WS] Received message: %s", msgStr);
|
||||
setLastMessage(message); // Store the last message in context
|
||||
} catch (error) {
|
||||
console.error("Error parsing WebSocket message:", error);
|
||||
|
||||
Reference in New Issue
Block a user