From b03309aca55e9c970f08a09f3ead28baea0309c5 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 25 Oct 2024 10:35:58 +0200 Subject: [PATCH] Encode s3 keys in source_url --- app/models/subscription_client_resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/subscription_client_resource.rb b/app/models/subscription_client_resource.rb index a61ce63..6c51e06 100644 --- a/app/models/subscription_client_resource.rb +++ b/app/models/subscription_client_resource.rb @@ -11,7 +11,7 @@ def get_source_url(bucket) return nil unless access_key_id && secret_access_key && s3_client return nil unless can_access_bucket?(bucket) - "s3://#{access_key_id}:#{secret_access_key}@#{bucket}" + "s3://#{CGI.escapeURIComponent(access_key_id)}:#{CGI.escapeURIComponent(secret_access_key)}@#{bucket}" end def can_access_bucket?(bucket)