mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 12:52:48 +08:00
FIX: use the right URL when downloading the file from S3
This commit is contained in:
parent
0b3d51a8bc
commit
14bbd5d167
|
@ -159,7 +159,8 @@ def migrate_from_s3
|
|||
begin
|
||||
if sha1 = Upload.sha1_from_short_url(url)
|
||||
if upload = Upload.find_by(sha1: sha1)
|
||||
file = FileHelper.download("http:#{url}", max_file_size: 20.megabytes, tmp_file_name: "from_s3", follow_redirect: true)
|
||||
if upload.url.start_with?("//")
|
||||
file = FileHelper.download("http:#{upload.url}", max_file_size: 20.megabytes, tmp_file_name: "from_s3", follow_redirect: true)
|
||||
filename = upload.original_filename
|
||||
origin = upload.origin
|
||||
upload.destroy
|
||||
|
@ -171,6 +172,7 @@ def migrate_from_s3
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
url
|
||||
rescue
|
||||
|
|
Loading…
Reference in New Issue
Block a user