Skip to content

Commit d7e73c3

Browse files
committed
fix(badges): do not allow caching
Ensure README badges are not cached by github
1 parent 876e93b commit d7e73c3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/pact_broker/api/resources/badge.rb

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def forbidden?
3131
private
3232

3333
def to_svg
34+
response.headers['Cache-Control'] = 'no-cache'
3435
badge_service.pact_verification_badge pact, label, initials, verification_status
3536
end
3637

spec/lib/pact_broker/api/resources/badge_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ module Resources
7676
expect(subject.status).to eq 200
7777
end
7878

79+
it "does not allow caching" do
80+
expect(subject.headers['Cache-Control']).to eq 'no-cache'
81+
end
82+
7983
it "returns the badge" do
8084
expect(subject.body).to eq "badge"
8185
end

0 commit comments

Comments
 (0)