From 26b0239af87809a85fe72e797dcbded222c13e5c Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 17 Jan 2016 20:18:47 +0000 Subject: Added support for using basic auth in http source --- lib/oxidized/source/http.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/oxidized') diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index 6e765cf..93361a2 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -28,6 +28,9 @@ class HTTP < Source end request = Net::HTTP::Get.new(uri.request_uri, headers) + if (@cfg.user && @cfg.pass) + request.basic_auth(@cfg.user,@cfg.pass) + end response = http.request(request) data = JSON.parse(response.body) -- cgit v1.2.1