zircote/oauth2-php — pull request #1 by tdupreeibp (2012-05-18 21:46:52+00:00)
Title: Add CORS support to ServerAuthentication Exception Responses

- Added header('Access-Control-Allow-Origin: *') to ServerException sendHttpResponse() method. This makes it possible for CORS supporting browsers to hand back the error message and status code to the XHR object that made the failed request. Otherwise the XHR request is failed and no information about the nature of its failure is provided to the object.

- Added a cal to parent::sendHeaders() to AuthenticateException so that the AuthenticateException http response includes the cache-control and content-type headers defined in ServerException. This lets the browser properly handle the JSON error object sent back in the response.