Skip to content

Commit

Permalink
fixes #2568 - don't pass entire URL to Get, use request_uri consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Cleal committed May 27, 2013
1 parent bbd0d19 commit b7ba7c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/external_node.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def upload_facts(certname, filename)
fact = File.read(filename)
begin
uri = URI.parse("#{url}/fact_values/create?format=yml")
req = Net::HTTP::Post.new(uri.path)
req = Net::HTTP::Post.new(uri.request_uri)
req.set_form_data('facts' => fact)
res = Net::HTTP.new(uri.host, uri.port)
res.use_ssl = uri.scheme == 'https'
Expand Down Expand Up @@ -99,7 +99,7 @@ end
def enc(certname)
foreman_url = "#{url}/node/#{certname}?format=yml"
uri = URI.parse(foreman_url)
req = Net::HTTP::Get.new(foreman_url)
req = Net::HTTP::Get.new(uri.request_uri)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
if http.use_ssl?
Expand Down

0 comments on commit b7ba7c3

Please sign in to comment.