author.php allow origin-cht.mycht.cn

mobile-first
lyt 6 years ago
parent b3513b58df
commit 5416bdaa5c

@ -8,6 +8,18 @@ class Login extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('Infoauthors_model');
if (isset($_SERVER['HTTP_ORIGIN'])) {
$http_origin = $_SERVER['HTTP_ORIGIN'];
$allowed_domains = array(
'https://cht.mycht.cn',
'https://origin-cht.mycht.cn'
);
if (in_array($http_origin, $allowed_domains))
{
header("Access-Control-Allow-Origin: $http_origin");
}
}
}
public function index() {
@ -229,4 +241,4 @@ class Login extends CI_Controller {
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
/* Location: ./application/controllers/welcome.php */

Loading…
Cancel
Save