@alisio/server 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,8 +146,12 @@ export function registerFileRoutes(router, ctx) {
146
146
  ? Math.min(requested, FILE_PREVIEW_BYTES)
147
147
  : FILE_PREVIEW_BYTES;
148
148
  const bytes = await readHeadBytes(abs, Math.min(max, info.size));
149
- // A PDF is streamed whole and inline so the browser's built-in viewer can render it.
149
+ // A PDF is streamed whole and inline so the browser's built-in viewer can render it. The web
150
+ // previews it in an <iframe>: allow only this origin to frame it (Chromium's PDF viewer does
151
+ // not run in a sandboxed context), overriding the app's global `X-Frame-Options: DENY`.
150
152
  if (looksPdf(bytes)) {
153
+ res.removeHeader("X-Frame-Options");
154
+ res.setHeader("Content-Security-Policy", "default-src 'none'; frame-ancestors 'self'");
151
155
  res.writeHead(200, {
152
156
  "Content-Type": "application/pdf",
153
157
  "Content-Length": info.size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisio/server",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Local HTTP + SSE server behind `alisio serve`: multi-workspace, multi-session web access to the Alisio agent core with a launch-token cookie, strict Host/Origin checks and fail-closed approvals. node:http only; runs on Node >=22.16 and Bun.",
5
5
  "author": "Gustavo Gutiérrez",
6
6
  "license": "MIT",
@@ -39,11 +39,11 @@
39
39
  "node": ">=22.16"
40
40
  },
41
41
  "dependencies": {
42
- "@alisio/core": "0.5.0",
43
- "@alisio/sdk": "0.5.0"
42
+ "@alisio/core": "0.5.1",
43
+ "@alisio/sdk": "0.5.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@alisio/web": "0.5.0"
46
+ "@alisio/web": "0.5.1"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public",