Fix HttpSocket test to actually reset protocols for correct test. Modify HttpSocket so that Https with non-passed in protocol doesn't set it to tcp and fail test.

This commit is contained in:
Melvin Ross 2014-06-12 09:37:03 -05:00
parent 460cc29fff
commit ad4dbdcee5
2 changed files with 5 additions and 2 deletions
lib/Cake/Network/Http

View file

@ -341,7 +341,7 @@ class HttpSocket extends CakeSocket {
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';
}