Merge pull request #25088 from nextcloud/fix/allow_app_updates_again

Allow installing/updating of apps again
This commit is contained in:
Roeland Jago Douma 2021-01-12 14:34:21 +01:00 committed by GitHub
commit e44f275cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 18 deletions

View File

@ -95,6 +95,12 @@ class Client implements IClient {
$options[RequestOptions::HEADERS]['Accept-Encoding'] = 'gzip';
}
// Fallback for save_to
if (isset($options['save_to'])) {
$options['sink'] = $options['save_to'];
unset($options['save_to']);
}
return $options;
}
@ -218,7 +224,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,
@ -249,7 +255,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,
@ -284,7 +290,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,
@ -324,7 +330,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,
@ -359,7 +365,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,
@ -394,7 +400,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* 'timeout' => 5,

View File

@ -286,7 +286,7 @@ class Installer {
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
$timeout = $this->isCLI ? 0 : 120;
$client = $this->clientService->newClient();
$client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => $timeout]);
$client->get($app['releases'][0]['download'], ['sink' => $tempFile, 'timeout' => $timeout]);
// Check if the signature actually matches the downloaded content
$certificate = openssl_get_publickey($app['certificate']);

View File

@ -55,7 +55,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse
@ -80,7 +80,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse
@ -110,7 +110,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse
@ -140,7 +140,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse
@ -170,7 +170,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse
@ -200,7 +200,7 @@ interface IClient {
* 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs
* ],
* 'save_to' => '/path/to/file', // save to a file or a stream
* 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file
* 'debug' => true,
* @return IResponse

View File

@ -348,7 +348,7 @@ u/spPSSVhaun5BA1FlphB2TkgnzlCmxJa63nFY045e/Jq+IKMcqqZl/092gbI2EQ
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
@ -432,7 +432,7 @@ YwDVP+QmNRzx72jtqAN/Kc3CvQ9nkgYhU65B95aX0xA=',
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
@ -515,7 +515,7 @@ YwDVP+QmNRzx72jtqAN/Kc3CvQ9nkgYhU65B95aX0xA=',
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
@ -594,7 +594,7 @@ MPLX6f5V9tCJtlH6ztmEcDROfvuVc0U3rEhqx2hphoyo+MZrPFpdcJL8KkIdMKbY
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->at(0))
->method('newClient')
@ -680,7 +680,7 @@ JXhrdaWDZ8fzpUjugrtC3qslsqL0dzgU37anS3HwrT8=',
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->at(1))
->method('newClient')