Skip to content

Commit 052282c

Browse files
Merge pull request #49 from Chargeback/fix-empty-response-obj-issue
Fix issue preventing correct response object from getting returned
2 parents d7bd3f8 + e9e32da commit 052282c

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

lib/rabbitmq/http/client.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,10 @@ def encode_uri_path_segment(segment)
426426
end
427427

428428
def decode_resource(response)
429-
case response.headers["content-length"]
430-
when nil then Hashie::Mash.new
431-
when 0 then Hashie::Mash.new
432-
when "0" then Hashie::Mash.new
429+
if response.body.empty?
430+
Hashie::Mash.new
433431
else
434-
if response.body.empty?
435-
Hashie::Mash.new
436-
else
437-
Hashie::Mash.new(response.body)
438-
end
432+
Hashie::Mash.new(response.body)
439433
end
440434
end
441435

0 commit comments

Comments
 (0)