lib/httpi/adapter/httpclient.rb in httpi-2.0.0 vs lib/httpi/adapter/httpclient.rb in httpi-2.0.1
- old
+ new
@@ -61,10 +61,18 @@
@client.ssl_config.verify_mode = ssl.openssl_verify_mode
@client.ssl_config.ssl_version = ssl.ssl_version if ssl.ssl_version
end
def respond_with(response)
- Response.new response.code, Hash[*response.header.all.flatten], response.content
+ headers = {}
+ response.header.all.each do |(header, value)|
+ if headers.key?(header)
+ headers[header] = Array(headers[header]) << value
+ else
+ headers[header] = value
+ end
+ end
+ Response.new response.code, headers, response.content
end
end
end
end