Give the site a favicon - #146
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Internet Identity’s SVG favicon across all site and authentication pages.
Changes:
- Serves cacheable
/favicon.svg. - Links the favicon from every HTML page.
- Updates strict CSPs to permit same-origin image loading.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/main.rs |
Adds the favicon route and tests. |
src/auth.rs |
Updates authentication-page CSPs and tests. |
src/assets/favicon.svg |
Adds the favicon asset. |
src/assets/index.html |
Preserves the icon through document replacement. |
src/assets/privacy-policy.html |
Links the favicon. |
src/assets/support.html |
Links the favicon. |
src/assets/terms.html |
Links the favicon. |
src/assets/connect-callback.html |
Links the favicon. |
src/assets/connect-error.html |
Links the favicon. |
README.md |
Documents favicon availability. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MRmarioruci
force-pushed
the
claude/mcp-site-favicon-c262af
branch
from
August 20, 2026 11:44
379fadb to
3327247
Compare
MRmarioruci
marked this pull request as draft
August 20, 2026 11:45
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/auth.rs:1488
- This security description is inaccurate:
img-src 'self'permits any same-origin URL as an image source, not exactly/favicon.svg. The narrower fact is that this page currently declares only the favicon; documenting that distinction avoids overstating the CSP restriction.
// `img-src 'self'` admits exactly one thing: the origin's own `/favicon.svg`,
// which browsers fetch for the `<link rel=icon>` in the head and which CSP
// governs as an image. Same-origin only, so it opens no path off this server;
// without it the tab renders the browser's default glyph mid-connect.
src/main.rs:178
- The public
McpServer::mcp_router()serves these connect pages to embedders, but/favicon.svgis only defined by this binary's privatesite_metadata_router. Consumers following the embedding contract insrc/lib.rs:239-258therefore get a guaranteed 404 for the new subresource. Please serve the icon from a reusable/prefixed library route, expose an asset router, or avoid adding the link to library-owned templates.
/// The connect screens in `auth.rs` link the same root-absolute `/favicon.svg`,
/// so an embedder that mounts the MCP router without `site_metadata_router` just
/// gets the browser's default glyph there.
aterga
previously approved these changes
Aug 20, 2026
The site had no favicon, so every page — the landing page, the policy documents, and the connect screens — rendered with the browser's default glyph. The icon is the full-colour ICP infinity mark, taken byte-identical from forumic.com, which already shares this site's palette. SVG rather than a raster `.ico`: it is 2 KB at every size, and it sits on transparency, so the browser's own chrome carries it in either theme and no light/dark variant is needed. It joins `site_metadata_router` alongside `/sitemap.xml` and `/robots.txt`, served as `image/svg+xml` with a day of cache. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`/`, `/privacy-policy`, `/support` and `/terms` each get a `<link rel=icon>` pointing at the new route. The landing page needs the link twice. Its bundle unpacks itself by parsing the embedded template and calling `documentElement.replaceWith`, which discards the shell `<head>` the export ships — icon included — so a copy has to ride into the template on the same head fragment the unpack routine already splices the resource map into. The shell copy stays because that is what a crawler running no JavaScript reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The pinned callback page and the shared error screen link the icon like every other page, but both run `default-src 'none'`, under which CSP governs a `<link rel=icon>` fetch as an image and drops it. Each gains `img-src 'self'`, which admits this origin's own `/favicon.svg` and nothing else; the nonce'd script and style rules are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MRmarioruci
force-pushed
the
claude/mcp-site-favicon-c262af
branch
from
August 20, 2026 11:55
3327247 to
9857050
Compare
MRmarioruci
marked this pull request as ready for review
August 20, 2026 11:58
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/auth.rs:1493
- The new favicon fetch makes the function's security contract stale: lines 1395–1398 still say
connect-srcis the page's only network reach and thatdefault-src 'none'forbids everything else. Please document this same-origin image exception so future CSP changes are assessed against the actual policy.
img-src 'self'; connect-src 'self'; base-uri 'none'; form-action 'none'; \
src/auth.rs:1601
- This exception contradicts
error_screen's rustdoc, which says the nonce'd style is the only allowed inline/resource content and everything else is denied. Update the contract to mention the same-origin favicon so the documented CSP matches the response.
"default-src 'none'; style-src 'nonce-{nonce}'; img-src 'self'; base-uri 'none'; \
aterga
approved these changes
Aug 20, 2026
aterga
approved these changes
Aug 20, 2026
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.
Summary
The site had no favicon. This adds one
Related issues
None.
Changes
GET /favicon.svgjoinssite_metadata_routernext to/sitemap.xmland/robots.txt, asimage/svg+xmlwith a day of cache. Each served page thenlinks it:
/,/privacy-policy,/supportand/termsinmain.rs, and thepinned callback page plus the shared error screen in
auth.rs. Because those tworun
default-src 'none', and CSP governs a<link rel=icon>fetch as an image,each of their headers gains
img-src 'self'— this origin's own file and nothingelse; the nonce'd script and style rules are untouched. That is the third commit
on its own, so it drops cleanly if you would rather leave those headers alone.
The landing page carries the link twice. Its bundle unpacks itself by parsing the
embedded template and calling
documentElement.replaceWith, which throws awaythe shell
<head>the Claude Design export ships — icon included — so a copyrides into the template on the head fragment the unpack routine already splices
the resource map into. The shell copy stays for a crawler running no JavaScript.
A re-export drops both; that is noted on
INDEX_HTML.Testing
cargo build --locked --all-targetscargo test --locked --all-targets— 204 pass, including two new ones for the route and the page links.cargo clippy --all-targets— no new warnings.cargo fmtnot run: the tree is not rustfmt-default formatted and it would reformat unrelated files.npm test --prefix monitoring/mcp-status(dashboard unchanged)Checked against a local
cargo run: the route returns the mark with the rightcontent type and cache header, Chrome fetches it from the link tag, and the
default-src 'none'error screen reports no CSP violation.Nothing is served at
/favicon.ico, so a browser without SVG-icon support fallsback to its default glyph. forumic.com also ships
favicon.ico,apple-touch-icon.pngandsafari-pinned-tab.svgif we want that coverage.Checklist
🤖 Generated with Claude Code