Merge pull request #76 from RobertElder/saas-relder-cors-localhost

Don't throw exceptions for localhost in CORSHelper.
This commit is contained in:
Albert Santoni 2014-10-29 17:35:25 -04:00
commit dd5176c209
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ class CORSHelper
//Chrome sends the Origin header for all requests, so we whitelist the webserver's hostname as well.
$response = $response->setHeader('Access-Control-Allow-Origin', '*');
$origin = $request->getHeader('Origin');
if (($origin != "") &&
if ((!(preg_match("/https?:\/\/localhost/", $origin) === 1)) && ($origin != "") &&
(!in_array($origin,
array("http://www.airtime.pro",
"https://www.airtime.pro",