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:
|
||||
# Send current track info immediately on connect
|
||||
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))
|
||||
|
||||
# Send LRC asynchronously
|
||||
@@ -598,6 +599,9 @@ class Radio(FastAPI):
|
||||
if station not in self.active_connections:
|
||||
return
|
||||
|
||||
# Remove sensitive file path info
|
||||
track_data.pop("file_path", None)
|
||||
|
||||
# Create broadcast message
|
||||
broadcast_data = {
|
||||
"type": "track_change",
|
||||
|
Reference in New Issue
Block a user