Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tweak cache key generation in Caching middleware

  • Loading branch information...
commit 7e89a7f2b659cbc81fa49196b0c6994ffe300089 1 parent 1caf5b1
Mislav Marohnić authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/faraday_stack/caching.rb
9 lib/faraday_stack/caching.rb
View
@@ -24,14 +24,11 @@ def call(env)
end
def cache_key(env)
- url = env[:url]
- if params_to_strip.any?
- url = url.dup
+ url = env[:url].dup
+ if url.query && params_to_strip.any?
url.query_values = url.query_values.reject { |k,| params_to_strip.include? k }
- url.normalize!
- else
- url = url.normalize
end
+ url.normalize!
url.request_uri
end
Please sign in to comment.
Something went wrong with that request. Please try again.