flexirest 1.3.31 → 1.3.32
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/request.rb +7 -9
- 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: d818096fc6d03908005c35317dbc5e0ab2f03994
|
4
|
+
data.tar.gz: a4ed3f0e1e7db9dd92d4c5fca478b0fc385edca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35af9776e44f7b291ba41753f4cb7efef1f2441ccd0aed3fd41474b27dce714d7951cfc9a6ad5fe98996e9399b3ecece34d9b00dab65b77a93fd38eac88ea07f
|
7
|
+
data.tar.gz: 45228f5f5c0fbcfde18bfa4bf5dac900024d9e45bd11d7957c80181da011e0ee253dbe59b55526b4fbf71199844b3bbc6b350874d851be3f6abf8527ae8dfd00
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/request.rb
CHANGED
@@ -195,7 +195,7 @@ module Flexirest
|
|
195
195
|
if verbose?
|
196
196
|
Flexirest::Logger.debug " Response"
|
197
197
|
Flexirest::Logger.debug " << Status : #{response_env.status}"
|
198
|
-
|
198
|
+
response_env.response_headers.each do |k,v|
|
199
199
|
Flexirest::Logger.debug " << #{k} : #{v}"
|
200
200
|
end
|
201
201
|
Flexirest::Logger.debug " << Body:\n#{response_env.body}"
|
@@ -500,8 +500,8 @@ module Flexirest
|
|
500
500
|
end
|
501
501
|
|
502
502
|
def hal_response?
|
503
|
-
_, content_type =
|
504
|
-
faked_response =
|
503
|
+
_, content_type = @response.response_headers.detect{|k,v| k.downcase == "content-type"}
|
504
|
+
faked_response = @response.response_headers.detect{|k,v| k.downcase == "x-arc-faked-response"}
|
505
505
|
if content_type && content_type.respond_to?(:each)
|
506
506
|
content_type.each do |ct|
|
507
507
|
return true if ct[%r{application\/hal\+json}i]
|
@@ -561,13 +561,11 @@ module Flexirest
|
|
561
561
|
end
|
562
562
|
|
563
563
|
def is_json_response?
|
564
|
-
|
565
|
-
headers['Content-Type'].nil? || headers['Content-Type'].include?('json')
|
564
|
+
@response.response_headers['Content-Type'].nil? || @response.response_headers['Content-Type'].include?('json')
|
566
565
|
end
|
567
566
|
|
568
567
|
def is_xml_response?
|
569
|
-
|
570
|
-
headers['Content-Type'].include?('xml')
|
568
|
+
@response.response_headers['Content-Type'].include?('xml')
|
571
569
|
end
|
572
570
|
|
573
571
|
def generate_new_object(options={})
|
@@ -607,8 +605,8 @@ module Flexirest
|
|
607
605
|
else
|
608
606
|
result = new_object(body, @overridden_name)
|
609
607
|
result._status = @response.status
|
610
|
-
result._headers =
|
611
|
-
result._etag =
|
608
|
+
result._headers = @response.response_headers
|
609
|
+
result._etag = @response.response_headers['ETag']
|
612
610
|
if !object_is_class? && options[:mutable] != false
|
613
611
|
@object._copy_from(result)
|
614
612
|
@object._clean!
|
data/lib/flexirest/version.rb
CHANGED