openclaw - ✅(Solved) Fix Control UI static assets (favicon, apple-touch-icon) return 404 under /__openclaw__/ prefix [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#80072Fetched 2026-05-11 03:19:08
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Timeline (top)
commented ×2closed ×1cross-referenced ×1

The Control UI HTML references static assets like ./apple-touch-icon.png, ./favicon-32.png, ./favicon.ico, ./favicon.svg, and ./manifest.webmanifest with relative paths. When the browser resolves these relative to /__openclaw__/, the requests become:

  • GET /__openclaw__/apple-touch-icon.png404
  • GET /__openclaw__/favicon-32.png404
  • GET /__openclaw__/favicon.ico404
  • GET /__openclaw__/favicon.svg404
  • GET /__openclaw__/manifest.webmanifest404

However, these same files are served correctly without the /__openclaw__/ prefix:

  • GET /apple-touch-icon.png200
  • GET /favicon.ico200

Meanwhile, assets/ subdirectory files work fine under the prefix:

  • GET /__openclaw__/assets/index-NYVkUQrq.js200
  • GET /__openclaw__/assets/index-DyaZOQpm.css200

The files exist on disk at:

.../openclaw/dist/control-ui/apple-touch-icon.png
.../openclaw/dist/control-ui/favicon-32.png
.../openclaw/dist/control-ui/favicon.ico
.../openclaw/dist/control-ui/favicon.svg

Root Cause

The Control UI HTML references static assets like ./apple-touch-icon.png, ./favicon-32.png, ./favicon.ico, ./favicon.svg, and ./manifest.webmanifest with relative paths. When the browser resolves these relative to /__openclaw__/, the requests become:

  • GET /__openclaw__/apple-touch-icon.png404
  • GET /__openclaw__/favicon-32.png404
  • GET /__openclaw__/favicon.ico404
  • GET /__openclaw__/favicon.svg404
  • GET /__openclaw__/manifest.webmanifest404

However, these same files are served correctly without the /__openclaw__/ prefix:

  • GET /apple-touch-icon.png200
  • GET /favicon.ico200

Meanwhile, assets/ subdirectory files work fine under the prefix:

  • GET /__openclaw__/assets/index-NYVkUQrq.js200
  • GET /__openclaw__/assets/index-DyaZOQpm.css200

The files exist on disk at:

.../openclaw/dist/control-ui/apple-touch-icon.png
.../openclaw/dist/control-ui/favicon-32.png
.../openclaw/dist/control-ui/favicon.ico
.../openclaw/dist/control-ui/favicon.svg

Fix Action

Workaround

The favicon and icons are accessible at the root path (e.g. http://127.0.0.1:18789/apple-touch-icon.png), but the Control UI HTML requests them relative to the /__openclaw__/ base path, so browsers show broken icons in the tab and bookmarks.

PR fix notes

PR #80105: fix(ui): use relative paths for favicon and icon references

Description (problem / solution / changelog)

Summary

  • Changed absolute paths (/favicon.svg, /favicon-32.png, /apple-touch-icon.png) to relative paths (./favicon.svg, etc.) in ui/index.html.
  • When Control UI is served under a non-root basePath (e.g. /__openclaw__/), absolute paths like /favicon.svg bypass the basePath prefix, causing the browser to request the wrong URL. Relative paths resolve correctly regardless of basePath.
  • manifest.webmanifest was already using a relative path and worked correctly.

Verification

  • Added test case in src/gateway/gateway-misc.test.ts confirming favicon.svg is served correctly under basePath /mybase.
  • All 37 tests in gateway-misc.test.ts pass.
  • Root-mounted (no basePath) behavior is unchanged: relative ./favicon.svg from / resolves to /favicon.svg.

Real behavior proof

Behavior or issue addressed: Control UI static assets (favicon.svg, favicon-32.png, apple-touch-icon.png) return 404 when the Control UI is served under a basePath like /__openclaw__/. The HTML used absolute paths (/favicon.svg) which bypass the basePath.

Real environment tested: Verified the path resolution logic in src/gateway/control-ui.ts at line 922-933 using node to confirm basePath stripping works correctly.

Exact steps or command run after the patch:

node -e "
const bp = '/__openclaw__';
const pathname = '/__openclaw__/favicon.svg';
const uiPath = pathname.startsWith(bp+'/') ? pathname.slice(bp.length) : pathname;
console.log('uiPath:', uiPath);
"

Evidence after fix: Terminal output from the path resolution verification and the source diff showing the fix:

-    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
-    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
-    <link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png" />
+    <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
+    <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
+    <link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png" />

The fix changes absolute paths to relative paths. When the page is at /__openclaw__/, ./favicon.svg resolves to /__openclaw__/favicon.svg. The server correctly strips basePath (/__openclaw__) and resolves to root/favicon.svg.

Observed result after fix: With the relative path fix, the browser correctly requests /__openclaw__/favicon.svg when the page is served under basePath /__openclaw__/. The Control UI handler strips the basePath and serves the file from the static root. Verified by the added test case that confirms GET /mybase/favicon.svg returns 200 with basePath: "/mybase".

What was not tested: No live gateway was started with basePath configured. The fix is a static HTML change — no runtime behavior beyond the path resolution that is already tested.

Closes #80072

Changed files

  • src/gateway/gateway-misc.test.ts (modified, +13/-0)
  • ui/index.html (modified, +3/-3)

Code Example

.../openclaw/dist/control-ui/apple-touch-icon.png
.../openclaw/dist/control-ui/favicon-32.png
.../openclaw/dist/control-ui/favicon.ico
.../openclaw/dist/control-ui/favicon.svg
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw 2026.5.7 (eeef486)
  • WSL2 on Windows 11
  • Gateway: loopback, port 18789

Description

The Control UI HTML references static assets like ./apple-touch-icon.png, ./favicon-32.png, ./favicon.ico, ./favicon.svg, and ./manifest.webmanifest with relative paths. When the browser resolves these relative to /__openclaw__/, the requests become:

  • GET /__openclaw__/apple-touch-icon.png404
  • GET /__openclaw__/favicon-32.png404
  • GET /__openclaw__/favicon.ico404
  • GET /__openclaw__/favicon.svg404
  • GET /__openclaw__/manifest.webmanifest404

However, these same files are served correctly without the /__openclaw__/ prefix:

  • GET /apple-touch-icon.png200
  • GET /favicon.ico200

Meanwhile, assets/ subdirectory files work fine under the prefix:

  • GET /__openclaw__/assets/index-NYVkUQrq.js200
  • GET /__openclaw__/assets/index-DyaZOQpm.css200

The files exist on disk at:

.../openclaw/dist/control-ui/apple-touch-icon.png
.../openclaw/dist/control-ui/favicon-32.png
.../openclaw/dist/control-ui/favicon.ico
.../openclaw/dist/control-ui/favicon.svg

Expected

Root-level static files in the control-ui directory should be served under /__openclaw__/ just like assets/ files are.

Workaround

The favicon and icons are accessible at the root path (e.g. http://127.0.0.1:18789/apple-touch-icon.png), but the Control UI HTML requests them relative to the /__openclaw__/ base path, so browsers show broken icons in the tab and bookmarks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Control UI static assets (favicon, apple-touch-icon) return 404 under /__openclaw__/ prefix [1 pull requests, 2 comments, 3 participants]