Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(proxy): reaching s3 storage behind some http proxy
Signed-off-by: Maxime Besson <[email protected]>
  • Loading branch information
maxbes committed Apr 9, 2021
commit 547438527d5184f786117a21f65ca51b95ee695c
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