This commit is contained in:
kicaj 2019-01-11 13:20:09 +01:00 committed by GitHub
parent 108313d74c
commit bcbe5fdcf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,7 +452,6 @@ class HttpSocket extends CakeSocket {
* @return false|HttpSocketResponse Result of request, either false on failure or the response to the request. * @return false|HttpSocketResponse Result of request, either false on failure or the response to the request.
*/ */
public function get($uri = null, $query = array(), $request = array()) { public function get($uri = null, $query = array(), $request = array()) {
if (!empty($query)) {
$uri = $this->_parseUri($uri, $this->config['request']['uri']); $uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) { if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query); $uri['query'] = array_merge($uri['query'], $query);
@ -460,7 +459,6 @@ class HttpSocket extends CakeSocket {
$uri['query'] = $query; $uri['query'] = $query;
} }
$uri = $this->_buildUri($uri); $uri = $this->_buildUri($uri);
}
$request = Hash::merge(array('method' => 'GET', 'uri' => $uri), $request); $request = Hash::merge(array('method' => 'GET', 'uri' => $uri), $request);
return $this->request($request); return $this->request($request);
@ -478,7 +476,6 @@ class HttpSocket extends CakeSocket {
* @return false|HttpSocketResponse Result of request, either false on failure or the response to the request. * @return false|HttpSocketResponse Result of request, either false on failure or the response to the request.
*/ */
public function head($uri = null, $query = array(), $request = array()) { public function head($uri = null, $query = array(), $request = array()) {
if (!empty($query)) {
$uri = $this->_parseUri($uri, $this->config['request']['uri']); $uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) { if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query); $uri['query'] = array_merge($uri['query'], $query);
@ -486,7 +483,6 @@ class HttpSocket extends CakeSocket {
$uri['query'] = $query; $uri['query'] = $query;
} }
$uri = $this->_buildUri($uri); $uri = $this->_buildUri($uri);
}
$request = Hash::merge(array('method' => 'HEAD', 'uri' => $uri), $request); $request = Hash::merge(array('method' => 'HEAD', 'uri' => $uri), $request);
return $this->request($request); return $this->request($request);