mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Create CORS rule on S3 only before a backup upload
This commit is contained in:
parent
d803dfc14a
commit
7e1f20b07f
@ -44,6 +44,7 @@ module BackupRestore
|
|||||||
obj = @s3_helper.object(filename)
|
obj = @s3_helper.object(filename)
|
||||||
raise BackupFileExists.new if obj.exists?
|
raise BackupFileExists.new if obj.exists?
|
||||||
|
|
||||||
|
ensure_cors!
|
||||||
presigned_url(obj, :put, UPLOAD_URL_EXPIRES_AFTER_SECONDS)
|
presigned_url(obj, :put, UPLOAD_URL_EXPIRES_AFTER_SECONDS)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -74,7 +75,6 @@ module BackupRestore
|
|||||||
end
|
end
|
||||||
|
|
||||||
def presigned_url(obj, method, expires_in_seconds)
|
def presigned_url(obj, method, expires_in_seconds)
|
||||||
ensure_cors!
|
|
||||||
obj.presigned_url(method, expires_in: expires_in_seconds)
|
obj.presigned_url(method, expires_in: expires_in_seconds)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user