Skip to content

Commit

Permalink
Merge branch 'master' into enable_multi_star_for_private_vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Oct 10, 2022
2 parents fc5fa79 + 166972d commit ec73e85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)
- [Disable rate limit protections](#disable-rate-limit-protections)
- [Keep your fork up to date](#keep-your-fork-up-to-date)

# Important Notice

Expand Down Expand Up @@ -454,6 +455,9 @@ See [the Vercel documentation](https://vercel.com/docs/concepts/projects/environ

> **Warning**
> Please be aware that disabling these rate limit protections increases the execution time of the serverless function as now more data needs to be fetched. As a result, GitHub users with many repositories might hit Vercel's [Serverless Function Execution Timeout](https://vercel.com/docs/concepts/limits/overview).
### 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

Expand Down
10 changes: 10 additions & 0 deletions tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,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_stats);
Expand Down

0 comments on commit ec73e85

Please sign in to comment.