Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: zircote/oauth2-php
...
head fork: zircote/oauth2-php
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 18, 2012
@tdupreeibp tdupreeibp add cors support to exception responses, include proper content heade…
…rs in auth exception response
a4d2ab6
Commits on May 19, 2012
@zircote Merge pull request #1 from tdupreeibp/oauth_exception_cors_support
Add CORS support to ServerAuthentication Exception Responses
52fbce8
View
1  library/OAuth2/Exception/AuthenticateException.php
@@ -56,6 +56,7 @@ public function __construct($httpCode, $tokenType, $realm, $error, $error_descri
* @ingroup oauth2_section_5
*/
protected function sendHeaders() {
+ parent::sendHeaders();
header($this->header);
}
}
View
2  library/OAuth2/Exception/ServerException.php
@@ -64,6 +64,8 @@ public function getHttpCode() {
public function sendHttpResponse() {
$this->sendHeaders();
header("HTTP/1.1 " . $this->getHttpCode());
+ // Allow all origins. This enables CORS requests to properly handle the response.
+ header('Access-Control-Allow-Origin: *');
echo (string) $this;
exit();
}

No commit comments for this range

Something went wrong with that request. Please try again.