lib/librarian/puppet/source/githubtarball.rb in librarian-puppet-maestrodev-0.9.8.1 vs lib/librarian/puppet/source/githubtarball.rb in librarian-puppet-maestrodev-0.9.9.1
- old
+ new
@@ -1,9 +1,11 @@
require 'uri'
require 'net/https'
require 'json'
+require 'librarian/puppet/version'
+
module Librarian
module Puppet
module Source
class GitHubTarball
class Repo
@@ -116,9 +118,13 @@
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
+
+ request.add_field "User-Agent",
+ "librarian-puppet v#{Librarian::Puppet::VERSION}"
+
resp = http.request(request)
if resp.code.to_i != 200
nil
else
data = resp.body