Skip to content

Commit

Permalink
Use the read method on the return of open_url to actually get the con…
Browse files Browse the repository at this point in the history
…tent.
  • Loading branch information
gerases authored and Sergei Gerasenko committed Mar 6, 2024
1 parent 802eb9a commit cbf9c7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/loadjson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Puppet::Parser::Functions
url = args[0]
end
begin
contents = OpenURI.open_uri(url, http_options)
contents = OpenURI.open_uri(url, http_options).read
rescue OpenURI::HTTPError => e
res = e.io
warning("Can't load '#{url}' HTTP Error Code: '#{res.status[0]}'")
Expand Down

0 comments on commit cbf9c7b

Please sign in to comment.