From f0f92c2635952be5820dae162bbdcf810b068c61 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Mon, 10 Oct 2022 12:48:26 +0200 Subject: [PATCH 1/3] test: add cache on error test --- tests/api.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/api.test.js b/tests/api.test.js index a6bb0920449e4..c05f25a63d005 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -174,6 +174,16 @@ describe("Test /api/", () => { ]); }); + it("should not store cache when error", async () => { + const { req, res } = faker({}, error); + await api(req, res); + + expect(res.setHeader.mock.calls).toEqual([ + ["Content-Type", "image/svg+xml"], + ["Cache-Control", `no-store`], + ]); + }); + it("should set proper cache with clamped values", async () => { { let { req, res } = faker({ cache_seconds: 200000 }, data); From c4bfacb9e0cf4df41bf01b75be72cfcd7ea207f7 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Mon, 10 Oct 2022 13:48:35 +0200 Subject: [PATCH 2/3] docs: add fork update guide --- readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.md b/readme.md index 9c35b708fb43f..aeaadf52c8a1e 100644 --- a/readme.md +++ b/readme.md @@ -92,6 +92,7 @@ Visit and make a small donation to hel - [Language Card Exclusive Options](#language-card-exclusive-options) - [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options) - [Deploy Yourself](#deploy-on-your-own-vercel-instance) + - [Keep your fork up to date](#keep-your-fork-up-to-date) # GitHub Stats Card @@ -440,6 +441,10 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme +#### Keep your fork up to date + +You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process. + ## :sparkling_heart: Support the project I open-source almost everything I can and try to reply to everyone needing help using these projects. Obviously, From 166972d7e4f12ab17ee7aa2b2000d784444bd9fd Mon Sep 17 00:00:00 2001 From: rickstaa Date: Mon, 10 Oct 2022 13:49:48 +0200 Subject: [PATCH 3/3] docs: improve syntax --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index aeaadf52c8a1e..9c773ff84707c 100644 --- a/readme.md +++ b/readme.md @@ -441,7 +441,7 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme -#### Keep your fork up to date +### Keep your fork up to date You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.