lib/httpx/plugins/response_cache.rb in httpx-0.22.5 vs lib/httpx/plugins/response_cache.rb in httpx-0.23.0
- old
+ new
@@ -6,11 +6,11 @@
# This plugin adds support for retrying requests when certain errors happen.
#
# https://gitlab.com/os85/httpx/wikis/Response-Cache
#
module ResponseCache
- CACHEABLE_VERBS = %i[get head].freeze
+ CACHEABLE_VERBS = %w[GET HEAD].freeze
CACHEABLE_STATUS_CODES = [200, 203, 206, 300, 301, 410].freeze
private_constant :CACHEABLE_VERBS
private_constant :CACHEABLE_STATUS_CODES
class << self
@@ -94,10 +94,10 @@
end
end
module RequestMethods
def response_cache_key
- @response_cache_key ||= Digest::SHA1.hexdigest("httpx-response-cache-#{@verb}#{@uri}")
+ @response_cache_key ||= Digest::SHA1.hexdigest("httpx-response-cache-#{@verb}-#{@uri}")
end
end
module ResponseMethods
def copy_from_cached(other)