flexirest 1.3.29 → 1.3.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/caching.rb +3 -2
- data/lib/flexirest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f486c610e559403248c73cd363d61cef2cc6189
|
4
|
+
data.tar.gz: 4c9dbe026c0ca6a04957882f88cd06ffb530b294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 515563435824f29cd71526ba447b5eaa5c8408d44cddef0690cf71354d8e4b2c99841cef905095879f5cb707b5fa31a7b2014904180bad3f2fa272029405d6d4
|
7
|
+
data.tar.gz: 306bb5c6193a912a0404895b090385617a9c16644a2c371ce0b0febc27512e75ff64828277a55d15a4fa2055bdad43b82472b65c44c675171d9a419385af6ea0
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/caching.rb
CHANGED
@@ -70,7 +70,7 @@ module Flexirest
|
|
70
70
|
if cache_store && (headers[:etag] || headers[:expires])
|
71
71
|
key = "#{request.class_name}:#{request.original_url}"
|
72
72
|
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{key} - Writing to cache"
|
73
|
-
cached_response = CachedResponse.new(status:response.status, result:result)
|
73
|
+
cached_response = CachedResponse.new(status:response.status, result:result, response_headers: headers)
|
74
74
|
cached_response.etag = "#{headers[:etag]}" if headers[:etag]
|
75
75
|
cached_response.expires = Time.parse(headers[:expires]) rescue nil if headers[:expires]
|
76
76
|
if cached_response.etag.present? || cached_response.expires
|
@@ -87,12 +87,13 @@ module Flexirest
|
|
87
87
|
end
|
88
88
|
|
89
89
|
class CachedResponse
|
90
|
-
attr_accessor :class_name, :status, :etag, :expires
|
90
|
+
attr_accessor :class_name, :status, :etag, :expires, :response_headers
|
91
91
|
|
92
92
|
def initialize(options)
|
93
93
|
@status = options[:status]
|
94
94
|
@etag = options[:etag]
|
95
95
|
@expires = options[:expires]
|
96
|
+
@response_headers = options[:response_headers]
|
96
97
|
|
97
98
|
@class_name = options[:result].class.name
|
98
99
|
if options[:result].is_a?(ResultIterator)
|
data/lib/flexirest/version.rb
CHANGED