Côme Chilliet
4 years ago
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
3 changed files with
7 additions and
7 deletions
-
lib/private/Files/ObjectStore/S3Signature.php
-
lib/private/Files/ObjectStore/Swift.php
-
tests/lib/Http/Client/ResponseTest.php
|
|
@ -137,7 +137,7 @@ class S3Signature implements SignatureInterface { |
|
|
|
$modify['set_headers']['X-Amz-Security-Token'] = $token; |
|
|
|
} |
|
|
|
|
|
|
|
return Psr7\modify_request($request, $modify); |
|
|
|
return Psr7\Utils::modifyRequest($request, $modify); |
|
|
|
} |
|
|
|
|
|
|
|
private function signString($string, CredentialsInterface $credentials) { |
|
|
@ -201,7 +201,7 @@ class S3Signature implements SignatureInterface { |
|
|
|
$query = $request->getUri()->getQuery(); |
|
|
|
|
|
|
|
if ($query) { |
|
|
|
$params = Psr7\parse_query($query); |
|
|
|
$params = Psr7\Query::parse($query); |
|
|
|
$first = true; |
|
|
|
foreach ($this->signableQueryString as $key) { |
|
|
|
if (array_key_exists($key, $params)) { |
|
|
|
|
|
@ -27,7 +27,7 @@ namespace OC\Files\ObjectStore; |
|
|
|
|
|
|
|
use GuzzleHttp\Client; |
|
|
|
use GuzzleHttp\Exception\BadResponseException; |
|
|
|
use function GuzzleHttp\Psr7\stream_for; |
|
|
|
use GuzzleHttp\Psr7\Utils; |
|
|
|
use Icewind\Streams\RetryWrapper; |
|
|
|
use OCP\Files\NotFoundException; |
|
|
|
use OCP\Files\ObjectStore\IObjectStore; |
|
|
@ -81,13 +81,13 @@ class Swift implements IObjectStore { |
|
|
|
if (filesize($tmpFile) < SWIFT_SEGMENT_SIZE) { |
|
|
|
$this->getContainer()->createObject([ |
|
|
|
'name' => $urn, |
|
|
|
'stream' => stream_for($handle), |
|
|
|
'stream' => Utils::streamFor($handle), |
|
|
|
'contentType' => $mimetype, |
|
|
|
]); |
|
|
|
} else { |
|
|
|
$this->getContainer()->createLargeObject([ |
|
|
|
'name' => $urn, |
|
|
|
'stream' => stream_for($handle), |
|
|
|
'stream' => Utils::streamFor($handle), |
|
|
|
'segmentSize' => SWIFT_SEGMENT_SIZE, |
|
|
|
'contentType' => $mimetype, |
|
|
|
]); |
|
|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
namespace Test\Http\Client; |
|
|
|
|
|
|
|
use GuzzleHttp\Psr7\Response as GuzzleResponse; |
|
|
|
use function GuzzleHttp\Psr7\stream_for; |
|
|
|
use GuzzleHttp\Psr7\Utils; |
|
|
|
use OC\Http\Client\Response; |
|
|
|
|
|
|
|
/** |
|
|
@ -25,7 +25,7 @@ class ResponseTest extends \Test\TestCase { |
|
|
|
} |
|
|
|
|
|
|
|
public function testGetBody() { |
|
|
|
$response = new Response($this->guzzleResponse->withBody(stream_for('MyResponse'))); |
|
|
|
$response = new Response($this->guzzleResponse->withBody(Utils::streamFor('MyResponse'))); |
|
|
|
$this->assertSame('MyResponse', $response->getBody()); |
|
|
|
} |
|
|
|
|
|
|
|