move ORIGINS to dbconn.php array
This commit is contained in:
parent
ece13a9f91
commit
6b13808ad8
@ -21,21 +21,10 @@ $HEADERS = apache_request_headers();
|
||||
$METHOD = $_SERVER['REQUEST_METHOD'];
|
||||
$REQ = [];
|
||||
|
||||
$ORIGINS = [
|
||||
'http://localhost:3000',
|
||||
'https://evo.quickcode.ru',
|
||||
'https://lk-evo.quickcode.ru',
|
||||
'https://wow.evoleasing.ru',
|
||||
'https://www.evoleasing.ru',
|
||||
'https://evoleasing.ru',
|
||||
'http://lk.evoleasing.ru',
|
||||
'https://lk.evoleasing.ru',
|
||||
];
|
||||
|
||||
$origin = isset($HEADERS['Origin']) ? $HEADERS['Origin'] : (isset($HEADERS['origin']) ? $HEADERS['origin'] : preg_replace(["/([^A-z.]+)/"], [""], isset($HEADERS['Host']) ? $HEADERS['Host'] : $HEADERS['host']));
|
||||
if($origin == "")
|
||||
{
|
||||
foreach($ORIGINS as $ORIGIN)
|
||||
foreach(ORIGINS as $ORIGIN)
|
||||
{
|
||||
if(strpos($HEADERS['referer'], $ORIGIN) !== FALSE)
|
||||
{
|
||||
@ -45,7 +34,7 @@ if($origin == "")
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($origin, $ORIGINS))
|
||||
if(in_array($origin, ORIGINS))
|
||||
{
|
||||
header('Access-Control-Allow-Origin: ' . $origin);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user