fix(gateway): return 404 for missing static assets instead of SPA fallback#12060
Merged
mbelinky merged 1 commit intoopenclaw:mainfrom Feb 20, 2026
Merged
Conversation
Contributor
Author
|
@greptile review |
Contributor
Author
|
@greptile review |
Contributor
Author
|
@greptile review |
a1c6914 to
011e4bd
Compare
011e4bd to
7420570
Compare
7420570 to
c5f2f8c
Compare
4ad6212 to
d9d4acf
Compare
bfc1ccb to
f92900f
Compare
ba77a3e to
33b269d
Compare
33b269d to
6941bc0
Compare
6941bc0 to
32d2ca7
Compare
Contributor
rodrigogs
pushed a commit
to rodrigogs/openclaw
that referenced
this pull request
Feb 20, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
Hansen1018
added a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 21, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
dgarson
pushed a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 21, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
mmyyfirstb
pushed a commit
to mmyyfirstb/openclaw
that referenced
this pull request
Feb 21, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
obviyus
pushed a commit
to guirguispierre/openclaw
that referenced
this pull request
Feb 22, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
Closed
6 tasks
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…lback (openclaw#12060) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 32d2ca7 Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11556
Summary
The webchat SPA catch-all route in
handleControlUiHttpRequest()servesindex.htmlfor all unmatched paths — including requests for static assets like/webchat/favicon.svg. This causes the logo to appear broken in the webchat UI because the browser receives HTML (withContent-Type: text/html) instead of the actual SVG file.Root Cause
In
src/gateway/control-ui.ts, the SPA fallback (lines 355-364) fires whenever a requested file doesn't exist on disk. It doesn't distinguish between:/webchat/chat) → should getindex.htmlfor client-side routing/webchat/favicon.svg) → should get 404 if the file is missingFix
Before the SPA fallback, check
path.extname(fileRel). If the requested path has a file extension and the file doesn't exist, return 404 instead of servingindex.html. Extensionless paths continue to get the SPA fallback as before.Test Plan
/webchat/favicon.svg) returns 404/webchat/chat) still getsindex.htmlfallback (200)pnpm buildpassespnpm checkpasses (lint + format)Greptile Overview
Greptile Summary
Changes tighten the Control UI (webchat SPA) fallback behavior so that requests for missing static assets (e.g.
.svg,.js,.css, etc.) return404 Not Foundinstead of incorrectly servingindex.html. This prevents browsers from receiving HTML for asset URLs (fixing broken favicon/logo scenarios) while preserving SPA routing for extensionless routes and dotted path segments.Implementation-wise,
src/gateway/control-ui.tsintroduces aSTATIC_ASSET_EXTENSIONSallowlist and checks it after the on-disk file lookup but before the SPAindex.htmlfallback. Tests insrc/gateway/control-ui.test.tscover missing-asset 404s (GET/HEAD), extensionless SPA fallback, dotted-route fallback, and.html-suffixed route fallback.Confidence Score: 5/5
index.html) plus regressions (dotted SPA routes and.htmlroutes). No additional functional issues were found in the modified code paths beyond the already-discussed prior threads.