Skip to content

Commit

Permalink
Make URI#open cross Ruby versions compatible
Browse files Browse the repository at this point in the history
Inspired-by: commit 30475c5
  • Loading branch information
pabs3 committed Jun 7, 2021
1 parent 66ff4d9 commit 9da87bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wayback_machine_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def download_file file_remote_info
structure_dir_path dir_path
open(file_path, "wb") do |file|
begin
URI.open("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}", "Accept-Encoding" => "plain") do |uri|
URI("https://web.archive.org/web/#{file_timestamp}id_/#{file_url}").open("Accept-Encoding" => "plain") do |uri|
file.write(uri.read)
end
rescue OpenURI::HTTPError => e
Expand Down

0 comments on commit 9da87bf

Please sign in to comment.