Fix coverage status card (shields.io CORS redirect) - #73
Merged
Conversation
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
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.
Problem
On dashban.com the browser console shows:
shields.io deprecated the
/coveralls/badge path. It now301-redirects to a/coverallsCoverage/...svgURL whose response carries noAccess-Control-Allow-Originheader (it returns408for that variant), so the browser blocksfetchCoverageStatusfrom 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=mainVerified: returns
200withaccess-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 twostatus-cardsassertions for the new URL).npm run test:coverage— 100% across all files (status-cards.jsincluded).npm run lint— 0 errors (7 pre-existing warnings unchanged).🤖 Generated with Claude Code
https://claude.ai/code/session_019VQjXJyM3EZPd4joy3EwaB
Generated by Claude Code