Skip to content

Commit

Permalink
Fix #12885
Browse files Browse the repository at this point in the history
  • Loading branch information
kicaj committed Jan 11, 2019
1 parent 108313d commit bcbe5fd
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions lib/Cake/Network/Http/HttpSocket.php
Expand Up @@ -452,15 +452,13 @@ public function request($request = array()) {
* @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()) {
if (!empty($query)) {
$uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query);
} else {
$uri['query'] = $query;
}
$uri = $this->_buildUri($uri);
$uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query);
} else {
$uri['query'] = $query;
}
$uri = $this->_buildUri($uri);

$request = Hash::merge(array('method' => 'GET', 'uri' => $uri), $request);
return $this->request($request);
Expand All @@ -478,15 +476,13 @@ public function get($uri = null, $query = array(), $request = array()) {
* @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()) {
if (!empty($query)) {
$uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query);
} else {
$uri['query'] = $query;
}
$uri = $this->_buildUri($uri);
$uri = $this->_parseUri($uri, $this->config['request']['uri']);
if (isset($uri['query'])) {
$uri['query'] = array_merge($uri['query'], $query);
} else {
$uri['query'] = $query;
}
$uri = $this->_buildUri($uri);

$request = Hash::merge(array('method' => 'HEAD', 'uri' => $uri), $request);
return $this->request($request);
Expand Down

0 comments on commit bcbe5fd

Please sign in to comment.