From 956bccc1c0de8549cfd33c83a70a358daad8b4dd Mon Sep 17 00:00:00 2001 From: Maxime Besson Date: Thu, 8 Apr 2021 18:00:12 +0200 Subject: [PATCH] fix(proxy): reaching s3 storage behind some http proxy Signed-off-by: Maxime Besson --- lib/private/Files/ObjectStore/S3ObjectTrait.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 7e75040e07b..bb71306c17d 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -50,8 +50,7 @@ trait S3ObjectTrait { */ public function readObject($urn) { return SeekableHttpStream::open(function ($range) use ($urn) { - $connection = $this->getConnection(); - $command = $connection->getCommand('GetObject', [ + $command = $this->getConnection()->getCommand('GetObject', [ 'Bucket' => $this->bucket, 'Key' => $urn, 'Range' => 'bytes=' . $range, @@ -70,8 +69,9 @@ trait S3ObjectTrait { ], ]; - if ($connection->getProxy()) { - $opts['http']['proxy'] = $connection->getProxy(); + if ($this->getProxy()) { + $opts['http']['proxy'] = $this->getProxy(); + $opts['http']['request_fulluri'] = true; } $context = stream_context_create($opts);