Skip to content

Commit 2285920

Browse files
authored
Handle 204 responses with HTTP keepalive
If the HTTP API is behind a proxy which has HTTP keepalive enabled, Faraday will assign a nil body on 204 responses.
1 parent ca0812c commit 2285920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rabbitmq/http/client/response_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(client)
1313
end
1414

1515
def decode_resource(response)
16-
if response.nil? || response.body.empty?
16+
if response.nil? || response.body.nil? || response.body.empty?
1717
Hashie::Mash.new
1818
else
1919
decode_response_body(response.body)

0 commit comments

Comments
 (0)