fix(api): do not cache error SVG responses on CDN#641
Conversation
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
👋 Hey @eshaanag, welcome to CommitPulse! 🎉 Thanks for opening your first pull request — this is a big deal and we appreciate the effort! While you wait for a review, please double-check:
A maintainer will review your PR shortly. Hang tight! 🚀 |
|
🚨 Hey @eshaanag, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
1a1ffa0 to
7e41e82
Compare
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
7e41e82 to
e2a03dc
Compare
|
Hi @maintainer, this PR was raised as part of GSSoC 2026 contribution. |
|
Hi maintainers, quick status update: the required GitHub Actions checks are passing and this PR is approved. The only remaining failing check is Vercel authorization, which seems to need maintainer approval from the project team. Could you please authorize/merge when convenient? |
Description
Fixes #622
Pillar
What changed
The catch-all error handler in
app/api/streak/route.ts:175was returning error SVG responses withCache-Control: public, s-maxage=60. This allowed CDNs to cache broken error badges for up to 60 seconds, meaning users embedding the badge in a README would continue seeing the error SVG even after the backend or GitHub had fully recovered.Changed the Cache-Control header on error responses to
no-storeso CDNs never cache transient failures. Success responses are unaffected.Visual Preview
N/A — this is a response header change only.
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors.fix(api): ...).README.mdif I added a new theme or URL parameter.