惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
雷峰网
雷峰网
爱范儿
爱范儿
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
F
Fortinet All Blogs
L
LangChain Blog
T
Tailwind CSS Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(control-ui): rewrite manifest hrefs for configured ba...
hugenshen · 2026-06-23 · via Recent Commits to openclaw:main

@@ -154,6 +154,21 @@ const CONTROL_UI_ROOT_PUBLIC_ASSETS = new Set([

154154

"sw.js",

155155

]);

156156157+

/** Rewrites root-absolute Control UI public asset hrefs for configured base paths. */

158+

export function rewriteControlUiIndexHtmlPublicAssetHrefs(html: string, basePath: string): string {

159+

const normalized = normalizeControlUiBasePath(basePath);

160+

if (!normalized) {

161+

return html;

162+

}

163+

let next = html;

164+

for (const asset of CONTROL_UI_ROOT_PUBLIC_ASSETS) {

165+

const rootHref = `href="/${asset}"`;

166+

const baseHref = `href="${normalized}/${asset}"`;

167+

next = next.split(rootHref).join(baseHref);

168+

}

169+

return next;

170+

}

171+157172

type ControlUiAvatarResolution =

158173

| { kind: "none"; reason: string; source?: string | null }

159174

| { kind: "local"; filePath: string; source?: string | null }

@@ -743,8 +758,9 @@ function serveResolvedFile(res: ServerResponse, filePath: string, body: Buffer)

743758

res.end(body);

744759

}

745760746-

function serveResolvedIndexHtml(res: ServerResponse, body: string) {

747-

const hashes = computeInlineScriptHashes(body);

761+

function serveResolvedIndexHtml(res: ServerResponse, body: string, basePath?: string) {

762+

const prepared = rewriteControlUiIndexHtmlPublicAssetHrefs(body, basePath ?? "");

763+

const hashes = computeInlineScriptHashes(prepared);

748764

if (hashes.length > 0) {

749765

res.setHeader(

750766

"Content-Security-Policy",

@@ -753,7 +769,7 @@ function serveResolvedIndexHtml(res: ServerResponse, body: string) {

753769

}

754770

res.setHeader("Content-Type", "text/html; charset=utf-8");

755771

res.setHeader("Cache-Control", "no-cache");

756-

res.end(body);

772+

res.end(prepared);

757773

}

758774759775

function readOpenedFile(fd: number): Promise<Buffer> {

@@ -1069,7 +1085,7 @@ export async function handleControlUiHttpRequest(

10691085

return true;

10701086

}

10711087

if (path.basename(safeFile.path) === "index.html") {

1072-

serveResolvedIndexHtml(res, await readOpenedFileText(safeFile.fd));

1088+

serveResolvedIndexHtml(res, await readOpenedFileText(safeFile.fd), basePath);

10731089

return true;

10741090

}

10751091

serveResolvedFile(res, safeFile.path, await readOpenedFile(safeFile.fd));

@@ -1097,7 +1113,7 @@ export async function handleControlUiHttpRequest(

10971113

if (respondHeadForFile(req, res, safeIndex.path)) {

10981114

return true;

10991115

}

1100-

serveResolvedIndexHtml(res, await readOpenedFileText(safeIndex.fd));

1116+

serveResolvedIndexHtml(res, await readOpenedFileText(safeIndex.fd), basePath);

11011117

return true;

11021118

} finally {

11031119

fs.closeSync(safeIndex.fd);