Changeset 353c39c in Klonkt


Ignore:
Timestamp:
05/20/2026 10:19:03 PM (4 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
c88783e
Parents:
21522ae
Message:

audio: allow blob: in CSP media-src (fix Step-1 no-play/auto-skip loop)

Step 1 (blob playback) shipped without blob: in the CSP media-src directive
("self" https:). The browser silently blocked <audio>.src = blob:... so the
player fired error on every track and auto-skipped through the whole queue
without playing anything. self/https: do NOT imply blob:.

Co-Authored-By: Claude Opus 4.7 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    r21522ae r353c39c  
    6464      imgSrc: ["'self'", "data:", "https:"],
    6565      connectSrc: ["'self'", "wss:", "ws:"],
    66       mediaSrc: ["'self'", "https:"],
     66      // blob: is required for the audio player — it fetch()es track bytes and
     67      // plays from a blob: object URL (Spotify-style). Without blob: here the
     68      // CSP silently blocks <audio>.src = blob:… → the player fires 'error' and
     69      // auto-skips every track. 'self'/https: do NOT imply blob:.
     70      mediaSrc: ["'self'", "https:", "blob:"],
    6771      fontSrc: ["'self'"],
    6872      frameSrc: [
Note: See TracChangeset for help on using the changeset viewer.