Remove file path information from track data in WebSocket responses (low/no-risk)
This commit is contained in:
@@ -538,6 +538,7 @@ class Radio(FastAPI):
|
|||||||
try:
|
try:
|
||||||
# Send current track info immediately on connect
|
# Send current track info immediately on connect
|
||||||
current_track = await self._get_now_playing_data(station)
|
current_track = await self._get_now_playing_data(station)
|
||||||
|
current_track.pop("file_path", None) # Ensure file_path is stripped
|
||||||
await websocket.send_text(json.dumps(current_track))
|
await websocket.send_text(json.dumps(current_track))
|
||||||
|
|
||||||
# Send LRC asynchronously
|
# Send LRC asynchronously
|
||||||
@@ -598,6 +599,9 @@ class Radio(FastAPI):
|
|||||||
if station not in self.active_connections:
|
if station not in self.active_connections:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Remove sensitive file path info
|
||||||
|
track_data.pop("file_path", None)
|
||||||
|
|
||||||
# Create broadcast message
|
# Create broadcast message
|
||||||
broadcast_data = {
|
broadcast_data = {
|
||||||
"type": "track_change",
|
"type": "track_change",
|
||||||
|
Reference in New Issue
Block a user