From 7e1f20b07fc41a6c164cb19773a600c94a844a74 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Mon, 17 Dec 2018 00:15:37 +0100 Subject: [PATCH] FIX: Create CORS rule on S3 only before a backup upload --- lib/backup_restore/s3_backup_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/backup_restore/s3_backup_store.rb b/lib/backup_restore/s3_backup_store.rb index 2fae590b70a..813e1ccceb8 100644 --- a/lib/backup_restore/s3_backup_store.rb +++ b/lib/backup_restore/s3_backup_store.rb @@ -44,6 +44,7 @@ module BackupRestore obj = @s3_helper.object(filename) raise BackupFileExists.new if obj.exists? + ensure_cors! presigned_url(obj, :put, UPLOAD_URL_EXPIRES_AFTER_SECONDS) end @@ -74,7 +75,6 @@ module BackupRestore end def presigned_url(obj, method, expires_in_seconds) - ensure_cors! obj.presigned_url(method, expires_in: expires_in_seconds) end