mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
460cc29fff
commit
ad4dbdcee5
2 changed files with 5 additions and 2 deletions
|
@ -341,7 +341,7 @@ class HttpSocket extends CakeSocket {
|
||||||
if (!empty($this->request['body']) && !isset($this->request['header']['Content-Length'])) {
|
if (!empty($this->request['body']) && !isset($this->request['header']['Content-Length'])) {
|
||||||
$this->request['header']['Content-Length'] = strlen($this->request['body']);
|
$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';
|
$this->config['protocol'] = 'ssl';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -493,7 +493,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'reset9' => array(
|
'reset10' => array(
|
||||||
'config.protocol' => 'ssl'
|
'config.protocol' => 'ssl'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
@ -524,6 +524,9 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'reset11' => array(
|
||||||
|
'config.protocol' => 'ssl'
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'request' => array(
|
'request' => array(
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
|
|
Loading…
Add table
Reference in a new issue