Add attachment text extraction, auto web news skill, and chat/voice UI updates.
Simplify asset upload temp paths, refresh deploy docs for Aliyun DNS topology, and ship MindSpace content-scan and auth improvements. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-3
@@ -53,6 +53,7 @@ import {
|
||||
preparePublicationHtmlForEmbed,
|
||||
isPlazaEmbedRequest,
|
||||
publishedPageCspForEmbed,
|
||||
stripPublicationHtmlCspMeta,
|
||||
} from './plaza-embed.mjs';
|
||||
import { createCleanupService } from './mindspace-cleanup.mjs';
|
||||
import { createAgentJobService } from './mindspace-agent-jobs.mjs';
|
||||
@@ -3002,11 +3003,14 @@ api.use(
|
||||
|
||||
app.use('/api', api);
|
||||
|
||||
function publishedPageCsp(html, { embed = false } = {}) {
|
||||
function publishedPageCsp(html, { embed = false, raw = false } = {}) {
|
||||
const isFullHtml = /^\s*<!doctype html/i.test(html) || /^\s*<html[\s>]/i.test(html);
|
||||
if (embed && isFullHtml) {
|
||||
return publishedPageCspForEmbed(true);
|
||||
}
|
||||
if (raw && isFullHtml) {
|
||||
return "default-src 'none'; style-src 'unsafe-inline' https:; img-src data: https:; font-src https: data:; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; script-src 'unsafe-inline'";
|
||||
}
|
||||
if (isFullHtml) {
|
||||
return "default-src 'none'; style-src 'unsafe-inline' https:; img-src data: https:; font-src https: data:; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; script-src 'none'";
|
||||
}
|
||||
@@ -3197,7 +3201,8 @@ function publishedPageShellHtml({ iframeUrl, shareUrl, title }) {
|
||||
</head>
|
||||
<body>
|
||||
<div class="publication-shell">
|
||||
<iframe class="publication-frame" title="${safeTitle}" src="${iframeSrc}"></iframe>
|
||||
<!-- Game-like publications need script execution inside the shell iframe. -->
|
||||
<iframe class="publication-frame" title="${safeTitle}" src="${iframeSrc}" sandbox="allow-same-origin allow-scripts"></iframe>
|
||||
</div>
|
||||
<button type="button" class="publication-share-fab" id="publication-share-fab">分享</button>
|
||||
<div class="publication-share-sheet" id="publication-share-sheet" hidden>
|
||||
@@ -3392,6 +3397,8 @@ function sendPublishedPage(req, res, result, { embed = false, raw = false } = {}
|
||||
let html = result.html;
|
||||
if (embed) {
|
||||
html = preparePublicationHtmlForEmbed(html);
|
||||
} else if (raw) {
|
||||
html = stripPublicationHtmlCspMeta(html);
|
||||
}
|
||||
const isFullHtml = /^\s*<!doctype html/i.test(html) || /^\s*<html[\s>]/i.test(html);
|
||||
const canWrapWithShell = !embed && !raw && isFullHtml && result.publication?.accessMode !== 'password';
|
||||
@@ -3416,7 +3423,7 @@ function sendPublishedPage(req, res, result, { embed = false, raw = false } = {}
|
||||
);
|
||||
}
|
||||
res.set('Content-Type', 'text/html; charset=utf-8');
|
||||
res.set('Content-Security-Policy', publishedPageCsp(html, { embed }));
|
||||
res.set('Content-Security-Policy', publishedPageCsp(html, { embed, raw }));
|
||||
res.set(
|
||||
'Cache-Control',
|
||||
result.publication.accessMode === 'public' ? 'public, max-age=60' : 'private, no-store',
|
||||
|
||||
Reference in New Issue
Block a user