Skip to content

Commit

Permalink
Don't overwrite WWW-Authenticate. Fixes #38.
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Dec 7, 2014
1 parent 5bc28e4 commit 5b6653b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ ChangeLog
------------------

* Hiding `Authorization` header value from `Request::__toString`.

* #38: The Authentication helpers no longer overwrite any existing
`WWW-Authenticate` headers, but instead append new headers. This ensures
that multiple authentication systems can exist in the same environment.

3.0.2 (2014-10-09)
------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/Auth/AWS.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function validate($secretKey) {
*/
function requireLogin() {

$this->response->setHeader('WWW-Authenticate','AWS');
$this->response->addHeader('WWW-Authenticate','AWS');
$this->response->setStatus(401);

}
Expand Down
2 changes: 1 addition & 1 deletion lib/Auth/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function getCredentials() {
*/
function requireLogin() {

$this->response->setHeader('WWW-Authenticate','Basic realm="' . $this->realm . '"');
$this->response->addHeader('WWW-Authenticate','Basic realm="' . $this->realm . '"');
$this->response->setStatus(401);

}
Expand Down
2 changes: 1 addition & 1 deletion lib/Auth/Digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function requireLogin() {
break;
}

$this->response->setHeader('WWW-Authenticate','Digest realm="' . $this->realm . '",qop="'.$qop.'",nonce="' . $this->nonce . '",opaque="' . $this->opaque . '"');
$this->response->addHeader('WWW-Authenticate','Digest realm="' . $this->realm . '",qop="'.$qop.'",nonce="' . $this->nonce . '",opaque="' . $this->opaque . '"');
$this->response->setStatus(401);

}
Expand Down

0 comments on commit 5b6653b

Please sign in to comment.