Skip to content

Commit

Permalink
Remove unnecessary duplicate lines (#10)
Browse files Browse the repository at this point in the history
In PR #3, headers were converted to lowercase, which resulted in
the same action being performed twice. This PR removes those
duplicate actions.

Co-authored-by: Moncef Belyamani <moncef@example.com>
  • Loading branch information
monfresh and Moncef Belyamani committed Jul 18, 2023
1 parent 37a5d52 commit d71032e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rack/cache/meta_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ def store(request, response, entity_store)
vary = response.vary
entries =
read(key).reject do |env, res|
(vary == (res['vary'] || res['vary'])) &&
(vary == (res['vary'])) &&
requests_match?(vary, env, stored_env)
end

headers = persist_response(response)
headers.delete('age')
headers.delete('age')

entries.unshift [stored_env, headers]
if request.env['rack-cache.use_native_ttl'] && response.fresh?
Expand Down

0 comments on commit d71032e

Please sign in to comment.