Skip to content
Permalink
Browse files

Fix HttpSocket test to actually reset protocols for correct test. Mod…

…ify HttpSocket so that Https with non-passed in protocol doesn't set it to tcp and fail test.
  • Loading branch information...
MelvinRoss committed Jun 12, 2014
1 parent 460cc29 commit ad4dbdcee5200f836d18dcd33c911a54b355a77e
Showing with 5 additions and 2 deletions.
  1. +1 −1 lib/Cake/Network/Http/HttpSocket.php
  2. +4 −1 lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
@@ -341,7 +341,7 @@ public function request($request = array()) {
if (!empty($this->request['body']) && !isset($this->request['header']['Content-Length'])) {
$this->request['header']['Content-Length'] = strlen($this->request['body']);
}
if (isset($this->request['uri']['scheme']) && $this->request['uri']['scheme'] === 'https' && empty($this->config['protocol'])) {
if (isset($this->request['uri']['scheme']) && $this->request['uri']['scheme'] === 'https' && in_array($this->config['protocol'], array(false, 'tcp'))) {
$this->config['protocol'] = 'ssl';
}
@@ -493,7 +493,7 @@ public function testRequest() {
)
)
),
'reset9' => array(
'reset10' => array(
'config.protocol' => 'ssl'
),
array(
@@ -524,6 +524,9 @@ public function testRequest() {
)
)
),
'reset11' => array(
'config.protocol' => 'ssl'
),
array(
'request' => array(
'method' => 'POST',

0 comments on commit ad4dbdc

Please sign in to comment.
You can’t perform that action at this time.