summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-01-17 22:46:17 +0200
committerytti <saku@ytti.fi>2016-01-17 22:46:17 +0200
commit9f49d6e7e3d30b561fef60d01059b9b2e4d771a7 (patch)
treed053ea9c7634d158f2a4ed67caaabc9b7c9cd04b /lib/oxidized
parentd3ad5b63ed0cc98fd6923e1065597441552892d8 (diff)
parent26b0239af87809a85fe72e797dcbded222c13e5c (diff)
Merge pull request #266 from laf/http-basic-auth
Added support for using basic auth in http source
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/source/http.rb3
1 files changed, 3 insertions, 0 deletions
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)