From eb525df3370008afb2c16bd67c28e4390ef57303 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Wed, 24 Apr 2024 18:00:07 +0200 Subject: [PATCH] reflect API change made for admin access --- script/file-download/copy_file.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/script/file-download/copy_file.rb b/script/file-download/copy_file.rb index eb10823460..6c90b41053 100644 --- a/script/file-download/copy_file.rb +++ b/script/file-download/copy_file.rb @@ -8,16 +8,17 @@ def initialize(save_path:) end def save(url:, token:, filename:) - puts url + # puts url # get redirect to the S3 presigned url - redir = HTTP.get(url, headers: { 'Authorization' => "Bearer #{token}" }) - if redir.code > 399 - STDERR.puts "Error #{redir.code} getting S3 presigned url for #{url}" - return - end + # redir = HTTP.get(url, headers: { 'Authorization' => "Bearer #{token}" }) + # if redir.code > 399 + # STDERR.puts "Error #{redir.code} getting S3 presigned url for #{url}" + # return + # end - response = HTTP.get(redir.headers['Location']) + # response = HTTP.get(redir.headers['Location']) + response = HTTP.get(url) outfn = File.join(@save_path, filename) puts "writing #{outfn}"