Skip to content

Commit

Permalink
fix(proxy): reaching s3 storage behind some http proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Besson <maxime.besson@worteks.com>
  • Loading branch information
maxbes committed Apr 9, 2021
1 parent 03fe74b commit 5474385
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/private/Files/ObjectStore/S3ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ abstract protected function getConnection();
*/
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,
Expand All @@ -71,8 +70,9 @@ public function readObject($urn) {
],
];

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);
Expand Down

0 comments on commit 5474385

Please sign in to comment.