aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Http/Client
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-15 07:27:31 +0200
committerGitHub <noreply@github.com>2018-06-15 07:27:31 +0200
commit3ea9f1887158ad13d75f2ad906dc7815d6b0dc41 (patch)
tree1d38585b6361ec46c9ecdeab73c9b0a0d3640064 /lib/private/Http/Client
parent84a1c915e6556f23f1e264094fed10a37e386b9a (diff)
parent00c3a7eb4c8eb7442705dc11d87d7bda3c69bd57 (diff)
downloadnextcloud-server-3ea9f1887158ad13d75f2ad906dc7815d6b0dc41.tar.gz
nextcloud-server-3ea9f1887158ad13d75f2ad906dc7815d6b0dc41.zip
Merge pull request #9873 from nextcloud/fix-http-client-given-options-being-overriden-by-default-options
Fix HTTP client given options being overriden by default options
Diffstat (limited to 'lib/private/Http/Client')
-rw-r--r--lib/private/Http/Client/Client.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php
index 0387fcabfaf..03b09bf54b7 100644
--- a/lib/private/Http/Client/Client.php
+++ b/lib/private/Http/Client/Client.php
@@ -158,7 +158,7 @@ class Client implements IClient {
*/
public function get(string $uri, array $options = []): IResponse {
$this->setDefaultOptions();
- $response = $this->client->request('get', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('get', $uri, array_merge($this->getRequestOptions(), $options));
$isStream = isset($options['stream']) && $options['stream'];
return new Response($response, $isStream);
}
@@ -189,7 +189,7 @@ class Client implements IClient {
*/
public function head(string $uri, array $options = []): IResponse {
$this->setDefaultOptions();
- $response = $this->client->request('head', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('head', $uri, array_merge($this->getRequestOptions(), $options));
return new Response($response);
}
@@ -228,7 +228,7 @@ class Client implements IClient {
$options['form_params'] = $options['body'];
unset($options['body']);
}
- $response = $this->client->request('post', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('post', $uri, array_merge($this->getRequestOptions(), $options));
return new Response($response);
}
@@ -263,7 +263,7 @@ class Client implements IClient {
*/
public function put(string $uri, array $options = []): IResponse {
$this->setDefaultOptions();
- $response = $this->client->request('put', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('put', $uri, array_merge($this->getRequestOptions(), $options));
return new Response($response);
}
@@ -298,7 +298,7 @@ class Client implements IClient {
*/
public function delete(string $uri, array $options = []): IResponse {
$this->setDefaultOptions();
- $response = $this->client->request('delete', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('delete', $uri, array_merge($this->getRequestOptions(), $options));
return new Response($response);
}
@@ -334,7 +334,7 @@ class Client implements IClient {
*/
public function options(string $uri, array $options = []): IResponse {
$this->setDefaultOptions();
- $response = $this->client->request('options', $uri, array_merge($options, $this->getRequestOptions()));
+ $response = $this->client->request('options', $uri, array_merge($this->getRequestOptions(), $options));
return new Response($response);
}
}