lib/flexirest/request.rb in flexirest-1.10.4 vs lib/flexirest/request.rb in flexirest-1.10.5
- old
+ new
@@ -310,11 +310,11 @@
end
end
result = handle_response(response_env, cached)
@response_delegate.__setobj__(result)
- original_object_class.write_cached_response(self, response_env, result)
+ original_object_class.write_cached_response(self, response_env, result) unless @method[:options][:skip_caching]
end
# If this was not a parallel request just return the original result
return result if response.finished?
# Otherwise return the delegate which will get set later once the call back is completed
@@ -521,11 +521,11 @@
end
end
def do_request(etag)
http_headers = {}
- http_headers["If-None-Match"] = etag if etag
+ http_headers["If-None-Match"] = etag if etag && !@method[:options][:skip_caching]
http_headers["Accept"] = "application/hal+json, application/json;q=0.5"
headers.each do |key,value|
value = value.join(",") if value.is_a?(Array)
http_headers[key] = value
end
@@ -888,10 +888,10 @@
add_nested_body_to_iterator(result, body)
else
result = new_object(body, @overridden_name)
result._status = @response.status
result._headers = @response.response_headers
- result._etag = @response.response_headers['ETag']
+ result._etag = @response.response_headers['ETag'] unless @method[:options][:skip_caching]
if !object_is_class? && options[:mutable] != false
@object._copy_from(result)
@object._clean!
result = @object
end