From 11de84e2cadfbaafe0f392434f2d75a6f97143d6 Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Wed, 15 Sep 2021 14:01:10 +0200 Subject: [PATCH] Use AWS region in URL --- CHANGELOG.md | 1 + src/Library/Sources/Services/AmazonS3/Presign.elm | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fde3bd2d..86e28e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Dark mode for the about page - Enforces usage of a secure context (HTTPS, localhost, etc) - Fixes audio preloading on non-Safari browsers on Apple devices +- Fixes issue with non-default AWS regions (now uses region in the url as well) - Fixes issue with shuffle algorithm - Fixes issue with WebDAV - Fixes playback issues (eg. clicking same track multiple times) diff --git a/src/Library/Sources/Services/AmazonS3/Presign.elm b/src/Library/Sources/Services/AmazonS3/Presign.elm index 1f413933..6510534c 100644 --- a/src/Library/Sources/Services/AmazonS3/Presign.elm +++ b/src/Library/Sources/Services/AmazonS3/Presign.elm @@ -56,7 +56,12 @@ presignedUrl method lifeExpectancyInSeconds extraParams currentTime srcData path |> String.chopEnd "/" Nothing -> - bucketName ++ ".s3.amazonaws.com" + case String.trim region of + "" -> + bucketName ++ ".s3.amazonaws.com" + + r -> + bucketName ++ ".s3." ++ r ++ ".amazonaws.com" protocol = if String.contains "http://" (Maybe.withDefault "" customHost) then -- 2.51.2