aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/S3ObjectTrait.php
diff options
context:
space:
mode:
authorSamuel <faust64@gmail.com>2021-03-13 12:05:27 +0100
committerMaxime Besson <maxime.besson@worteks.com>2021-04-09 10:15:57 +0200
commit03fe74b95e23df70d3cd4815a84b6fa22a06ee81 (patch)
tree101338455cc0087865950b4e0e591e1ab47bb094 /lib/private/Files/ObjectStore/S3ObjectTrait.php
parent32551b9ff7978395ec7777f11320056ab8413432 (diff)
downloadnextcloud-server-03fe74b95e23df70d3cd4815a84b6fa22a06ee81.tar.gz
nextcloud-server-03fe74b95e23df70d3cd4815a84b6fa22a06ee81.zip
fix(proxy): reaching s3 storage behind some http proxy
Signed-off-by: Maxime Besson <maxime.besson@worteks.com>
Diffstat (limited to 'lib/private/Files/ObjectStore/S3ObjectTrait.php')
-rw-r--r--lib/private/Files/ObjectStore/S3ObjectTrait.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php
index 4d6ac3608df..3f9d86f8e2b 100644
--- a/lib/private/Files/ObjectStore/S3ObjectTrait.php
+++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php
@@ -51,7 +51,8 @@ trait S3ObjectTrait {
*/
public function readObject($urn) {
return SeekableHttpStream::open(function ($range) use ($urn) {
- $command = $this->getConnection()->getCommand('GetObject', [
+ $connection = $this->getConnection();
+ $command = $connection->getCommand('GetObject', [
'Bucket' => $this->bucket,
'Key' => $urn,
'Range' => 'bytes=' . $range,
@@ -70,6 +71,10 @@ trait S3ObjectTrait {
],
];
+ if ($connection->getProxy()) {
+ $opts['http']['proxy'] = $connection->getProxy();
+ }
+
$context = stream_context_create($opts);
return fopen($request->getUri(), 'r', false, $context);
});