lib/flexirest/request.rb in flexirest-1.2.14 vs lib/flexirest/request.rb in flexirest-1.2.15
- old
+ new
@@ -152,10 +152,10 @@
end
append_get_parameters
prepare_request_body
self.original_url = self.url
cached = original_object_class.read_cached_response(self)
- if cached
+ if cached && !cached.is_a?(String)
if cached.expires && cached.expires > Time.now
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest::NAME}\033[0m #{@instrumentation_name} - Absolutely cached copy found"
return handle_cached_response(cached)
elsif cached.etag.to_s != "" #present? isn't working for some reason
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest::NAME}\033[0m #{@instrumentation_name} - Etag cached copy found with etag #{cached.etag}"