mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Added test to a request that server dont response WWW-Authenticate.
This commit is contained in:
parent
3056fbf680
commit
af06b8f179
1 changed files with 19 additions and 0 deletions
|
@ -37,6 +37,12 @@ class DigestHttpSocket extends HttpSocket {
|
|||
* @return void
|
||||
*/
|
||||
public function request($request) {
|
||||
if ($request === false) {
|
||||
if (isset($this->response['header']['WWW-Authenticate'])) {
|
||||
unset($this->response['header']['WWW-Authenticate']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
$this->response['header']['WWW-Authenticate'] = $this->nextHeader;
|
||||
}
|
||||
|
||||
|
@ -179,4 +185,17 @@ class DigestAuthenticationTest extends CakeTestCase {
|
|||
$this->assertNotEqual($response, 'da7e2a46b471d77f70a9bb3698c8902b');
|
||||
}
|
||||
|
||||
/**
|
||||
* testNoDigestResponse method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testNoDigestResponse() {
|
||||
$this->HttpSocket->nextHeader = false;
|
||||
$this->HttpSocket->request['uri']['path'] = '/admin';
|
||||
$this->HttpSocket->config['request']['auth'] = array();
|
||||
DigestAuthentication::authentication($this->HttpSocket);
|
||||
$this->assertFalse(isset($this->HttpSocket->request['header']['Authorization']));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue