aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore
diff options
context:
space:
mode:
authorJosh <josh.t.richards@gmail.com>2024-06-03 17:31:26 -0400
committerFerdinand Thiessen <opensource@fthiessen.de>2024-06-13 09:37:03 +0200
commitfcdf453b58fae2f7097acd31b2fa6745a2772264 (patch)
tree8ed62d5fcb0f2a716d8a3578890dc755bd7a84a8 /lib/private/Files/ObjectStore
parent6ebbc382ca42db7868019149a3e16182b96dc859 (diff)
downloadnextcloud-server-fcdf453b58fae2f7097acd31b2fa6745a2772264.tar.gz
nextcloud-server-fcdf453b58fae2f7097acd31b2fa6745a2772264.zip
fix(ObjectStore): handle empty S3 hostname
Fixes #45637 The support for s3-accelerate added in #44496 introduced a regression in AWS S3 environments when `hostname` is blank (which is a valid configuration w/ AWS since the hostname gets auto-generated). Signed-off-by: Josh <josh.t.richards@gmail.com>
Diffstat (limited to 'lib/private/Files/ObjectStore')
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index e7e6f23d435..61fee13aecf 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -71,8 +71,8 @@ trait S3ConnectionTrait {
$this->copySizeLimit = $params['copySizeLimit'] ?? 5242880000;
$this->useMultipartCopy = (bool)($params['useMultipartCopy'] ?? true);
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
- $params['s3-accelerate'] = $params['hostname'] == 's3-accelerate.amazonaws.com' || $params['hostname'] == 's3-accelerate.dualstack.amazonaws.com';
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
+ $params['s3-accelerate'] = $params['hostname'] === 's3-accelerate.amazonaws.com' || $params['hostname'] === 's3-accelerate.dualstack.amazonaws.com';
if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443;
}