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() { function __construct() {
parent::__construct(); parent::__construct();
$this->load->model('Infoauthors_model'); $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() { public function index() {

Loading…
Cancel
Save