Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

Merge main into cindy/vibrant-panini and resolve media CSP overlap

Jazer6868a50cf3fe
diff --cc apps/desktop/src/main/security/__tests__/csp.test.ts
index 71a76ee8e2,545cf02f1a..df462f63b1
--- a/apps/desktop/src/main/security/__tests__/csp.test.ts
+++ b/apps/desktop/src/main/security/__tests__/csp.test.ts
@@@ -75,17 -75,11 +75,17 @@@ describe('buildContentSecurityPolicy �
for (const scheme of ['xdt-image:', 'xdt-file:', 'xdt-video:', 'xdt-model:', 'cindy-remote-media:', 'cindy-media:']) {
expect(d['img-src']).toContain(scheme);
}
- // Local cindy-ui video uses xdt-file; audio uses the dedicated xdt-audio
- // handler. Omitting either makes Chromium reject media before decoding.
- for (const scheme of ['xdt-audio:', 'xdt-file:', 'xdt-video:', 'cindy-remote-media:', 'cindy-media:']) {
+ // Local MP4 answers resolve to xdt-file, not the generated-video store.
+ // Missing this source blocks playback before the file handler sees a request.
+ for (const scheme of ['xdt-file:', 'xdt-audio:', 'xdt-video:', 'cindy-remote-media:', 'cindy-media:']) {
expect(d['media-src']).toContain(scheme);
}
+ for (const directive of ['script-src', 'connect-src', 'frame-src']) {
+ expect(d[directive]).not.toContain('xdt-file:');
+ expect(d[directive]).not.toContain('xdt-audio:');
+ }
+ expect(d['media-src']).not.toContain('*');
+ expect(d['media-src']).not.toContain('file:');
// data: / blob: needed for canvas, object URLs, inline assets.
expect(d['img-src']).toEqual(expect.arrayContaining(['data:', 'blob:']));
expect(d['media-src']).toEqual(expect.arrayContaining(['blob:']));