lib/truemail/client/http.rb in truemail-client-0.2.0 vs lib/truemail/client/http.rb in truemail-client-0.2.1
- old
+ new
@@ -25,10 +25,12 @@
Net::HTTP.start(uri.host, uri.port, use_ssl: secure_connection) do |http|
request = Net::HTTP::Get.new(uri)
request['User-Agent'] = Truemail::Client::Http::USER_AGENT
request['Accept'] = Truemail::Client::Http::MIME_TYPE
request['Content-Type'] = Truemail::Client::Http::MIME_TYPE
- request['Authorization'] = Truemail::Client.configuration.token
+ unless endpoint.eql?(Truemail::Client::Http::HEALTHCHECK_ENDPOINT)
+ request['Authorization'] = Truemail::Client.configuration.token
+ end
http.request(request)
end.body
rescue => error
{ truemail_client_error: error }.to_json
end