Skip to content

Commit

Permalink
Handle 204 responses with HTTP keepalive
Browse files Browse the repository at this point in the history
If the HTTP API is behind a proxy which has HTTP keepalive enabled, Faraday will assign a nil body on 204 responses.
  • Loading branch information
carlhoerberg authored Oct 31, 2022
1 parent ca0812c commit 2285920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rabbitmq/http/client/response_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(client)
end

def decode_resource(response)
if response.nil? || response.body.empty?
if response.nil? || response.body.nil? || response.body.empty?
Hashie::Mash.new
else
decode_response_body(response.body)
Expand Down

0 comments on commit 2285920

Please sign in to comment.