Skip to content

Commit

Permalink
fix(badges): do not allow caching
Browse files Browse the repository at this point in the history
Ensure README badges are not cached by github
  • Loading branch information
bethesque committed Sep 26, 2017
1 parent 876e93b commit d7e73c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pact_broker/api/resources/badge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def forbidden?
private

def to_svg
response.headers['Cache-Control'] = 'no-cache'
badge_service.pact_verification_badge pact, label, initials, verification_status
end

Expand Down
4 changes: 4 additions & 0 deletions spec/lib/pact_broker/api/resources/badge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ module Resources
expect(subject.status).to eq 200
end

it "does not allow caching" do
expect(subject.headers['Cache-Control']).to eq 'no-cache'
end

it "returns the badge" do
expect(subject.body).to eq "badge"
end
Expand Down

0 comments on commit d7e73c3

Please sign in to comment.