Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: script to reflect API change made for admin access #1624

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions script/file-download/copy_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Loading