lib/httpx/plugins/response_cache.rb in httpx-0.23.4 vs lib/httpx/plugins/response_cache.rb in httpx-0.24.0

- old
+ new

@@ -100,13 +100,13 @@ end end module ResponseMethods def copy_from_cached(other) - @body = other.body + @body = other.body.dup - @body.__send__(:rewind) + @body.rewind end # A response is fresh if its age has not yet exceeded its freshness lifetime. def fresh? if cache_control @@ -167,10 +167,10 @@ end def date @date ||= Time.httpdate(@headers["date"]) rescue NoMethodError, ArgumentError - Time.now.httpdate + Time.now end end end register_plugin :response_cache, ResponseCache end