Skip to content

fix(seo): unblock the preview card (CORP) and add .ico/.png favicons - #3

Merged
imgul merged 1 commit into
mainfrom
arena/e1235655-env-compare
Oct 20, 2026
Merged

imgul merged 1 commit into
mainfrom
arena/e1235655-env-compare

Conversation

@imgul

@imgul imgul commented Oct 20, 2026

Copy link
Copy Markdown
Member

The card was not broken — it was blocked

GET /og-image.png returned 200, image/png, 366 010 bytes, and the PNG decoded cleanly (1200×630, CRC valid, complete pixel stream). Every preview panel still drew an empty box, because the catch-all header rule had stamped it with:

Cross-Origin-Resource-Policy: same-origin

Browsers obey CORP on no-cors requests — which is exactly what <img> is — so a page on another origin (opengraph.to, Slack web, Discord web) is refused permission to display it. A server-side crawler never sees the header, so "is it 200?" says yes and the card says nothing. That is why this survived the last round of verification: I checked the status code and inferred the rest. Bad inference, fixed here.

Fix — static assets (og-image.png, all icons, robots.txt, sitemap.xml, the manifest) now send Cross-Origin-Resource-Policy: cross-origin. Documents keep same-origin, so the app still cannot be framed. tests/unit/metadata.test.ts now fails if the card's CORP is anything else, and fails if documents stop being same-origin.

The two scoring warnings

Missing <h1> — the app renders one client-side, but preview bots and crawlers do not run JavaScript, so the served HTML had no heading. index.html now ships a visually hidden <h1> inside #root, and a test asserts React clears it on mount so the rendered page still has exactly one. Also added a <noscript> paragraph — the honest answer for a tool that cannot work without JavaScript.

SVG-only favicon — Google Search ignores SVG favicons. Added favicon.ico (16/32/48), favicon-16x16.png and favicon-32x32.png, drawn from the same tile geometry as the app mark, linked ahead of the SVG. The test parses the ICO directory and verifies every advertised size really exists.

Not done

twitter:site needs a real X handle. Inventing one would point the attribution at somebody else's account, so it is omitted — it is a one-line addition once the handle exists.

Verification

npx tsc · 382 tests / 19 files · npm run build · npm run privacy — green. After deploy, /og-image.png should return Cross-Origin-Resource-Policy: cross-origin.

The card was never broken: /og-image.png returned 200, image/png, 366 KB and
decoded cleanly. The catch-all header rule added Cross-Origin-Resource-Policy:
same-origin to it, and browsers refuse to render a cross-origin <img> with that
policy — so every preview panel drew an empty box while curl saw a healthy 200.

- vercel.json: static assets (card, icons, robots, sitemap, manifest) now send
  Cross-Origin-Resource-Policy: cross-origin; documents stay same-origin.
- index.html: a visually hidden <h1> in #root for crawlers that do not run JS
  (React clears it on mount, verified by test), plus a <noscript> explanation.
- index.html: favicon.ico (16/32/48), favicon-16x16.png and favicon-32x32.png
  drawn from the same tile geometry — Google ignores SVG favicons.
- tests: CORP policy per asset, ICO directory sizes, every advertised icon
  exists at its declared size, and exactly one H1 in the served HTML.

382 tests, typecheck, build and privacy guard green.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@imgul
imgul merged commit 8d0c8bb into main Oct 20, 2026
1 check failed
imgul added a commit that referenced this pull request Oct 20, 2026
fix(seo): unblock the preview card (CORP) and add .ico/.png favicons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant