Skip to content

Fix coverage status card (shields.io CORS redirect) - #73

Merged
super3 merged 1 commit into
mainfrom
claude/kind-ritchie-pr4kzv
Jun 29, 2026
Merged

Fix coverage status card (shields.io CORS redirect)#73
super3 merged 1 commit into
mainfrom
claude/kind-ritchie-pr4kzv

Conversation

@super3

@super3 super3 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Problem

On dashban.com the browser console shows:

Access to fetch at 'https://img.shields.io/coverallsCoverage/github/super3/dashban.svg?...&branch=main'
(redirected from 'https://img.shields.io/coveralls/github/super3/dashban/main.svg?...')
blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present
status-cards.js: Error fetching coverage status: TypeError: Failed to fetch

shields.io deprecated the /coveralls/ badge path. It now 301-redirects to a /coverallsCoverage/...svg URL whose response carries no Access-Control-Allow-Origin header (it returns 408 for that variant), so the browser blocks fetchCoverageStatus from reading the SVG body cross-origin. The coverage card silently falls back to "unknown".

This is pre-existing and unrelated to the recent Clerk auth work (#72) — it only surfaced when looking at the console.

Fix

Point buildBadgeUrl('coverage') at the current non-redirecting endpoint:

https://img.shields.io/coverallsCoverage/github/super3/dashban?branch=main

Verified: returns 200 with access-control-allow-origin: * and a parseable SVG body. The cache-buster is now joined with & since this URL already carries ?branch=main.

Testing

  • npm test — 959 passing (updated the two status-cards assertions for the new URL).
  • npm run test:coverage100% across all files (status-cards.js included).
  • npm run lint — 0 errors (7 pre-existing warnings unchanged).

🤖 Generated with Claude Code

https://claude.ai/code/session_019VQjXJyM3EZPd4joy3EwaB


Generated by Claude Code

shields.io deprecated the /coveralls/ badge path. It now 301-redirects
to a /coverallsCoverage/ URL whose response lacks CORS headers, so on
dashban.com the browser blocked status-cards.js from reading the SVG
body cross-origin and the coverage card fell back to "unknown".

Point buildBadgeUrl('coverage') at the current /coverallsCoverage/
endpoint, which serves the badge directly with access-control-allow-origin: *,
and join the cache-buster with & since that URL already carries
?branch=main.

Full suite green at 100% coverage; lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VQjXJyM3EZPd4joy3EwaB
@railway-app
railway-app Bot temporarily deployed to dashban / dashban-pr-73 June 29, 2026 16:20 Destroyed
@super3
super3 merged commit 1171b0a into main Jun 29, 2026
2 checks passed
@super3
super3 deleted the claude/kind-ritchie-pr4kzv branch June 29, 2026 16:21
@super3 super3 added the archive label Jun 29, 2026 — with Dashban
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants