setHeader('Access-Control-Allow-Origin', '*'); $origin = $request->getHeader('Origin'); if (($origin != "") && (!in_array($origin, array("http://www.airtime.pro", "https://www.airtime.pro", "http://" . $_SERVER['SERVER_NAME'], "https://" . $_SERVER['SERVER_NAME'] )) )) { //Don't allow CORS from other domains to prevent XSS. throw new Zend_Controller_Action_Exception('Forbidden', 403); } } }