Skip to content

Commit 374535c

Browse files
authored
Fix custom S3 endpoint config (#199)
When using the standard AWS S3 service, the `nil` values in `s3_scheme`, `s3_host` and `s3_port` create problems.
1 parent 6f0a4c3 commit 374535c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config/runtime.exs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ config :ex_aws,
261261
access_key_id: s3_access_key_id,
262262
secret_access_key: s3_secret_access_key,
263263
region: s3_region,
264-
normalize_path: false,
265-
s3: [scheme: s3_scheme, host: s3_host, port: s3_port]
264+
normalize_path: false
265+
266+
if s3_scheme && s3_host do
267+
config :ex_aws,
268+
s3: [scheme: s3_scheme, host: s3_host, port: s3_port]
269+
end
266270

267271
config :swoosh, :api_client, Swoosh.ApiClient.Finch

0 commit comments

Comments
 (0)