Skip to content

Commit 5c984d5

Browse files
committed
fix #59: prevent caching of github contribution calendar
1 parent 1a68d3e commit 5c984d5

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ require (
1818
go.octolab.org v0.12.0
1919
go.octolab.org/toolkit/cli v0.6.3
2020
go.octolab.org/toolkit/config v0.0.4
21+
go.octolab.org/toolkit/protocol v0.1.0
2122
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401
2223
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
2324
gopkg.in/yaml.v2 v2.4.0

go.sum

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/service/github/contribution.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/PuerkitoBio/goquery"
1212
"go.octolab.org/safe"
13+
"go.octolab.org/toolkit/protocol/http/header"
1314
"go.octolab.org/unsafe"
1415
"golang.org/x/sync/errgroup"
1516

@@ -78,6 +79,7 @@ func fetchContributions(ctx context.Context, user string, year int) (*goquery.Do
7879
HttpOnly: true,
7980
SameSite: http.SameSiteLaxMode,
8081
})
82+
req.Header.Set(header.CacheControl, "no-cache")
8183

8284
// TODO:debt use srv.client.Client() instead
8385
resp, err := http.DefaultClient.Do(req)

0 commit comments

Comments
 (0)