remove extra db call cuz i sredundant

This commit is contained in:
Isaac Connor 2017-01-18 21:12:54 -05:00
parent 61827fec0c
commit 8ce7719a33
1 changed files with 2 additions and 2 deletions

View File

@ -92,12 +92,12 @@ function CORSHeaders() {
# Only need CORSHeaders in the event that there are multiple servers in use.
return;
}
foreach( dbFetchAll( 'SELECT * FROM Servers' ) as $row ) {
foreach( $servers as $row ) {
$Server = new Server( $row );
if ( $_SERVER['HTTP_ORIGIN'] == $Server->Url() ) {
$valid = true;
header("Access-Control-Allow-Origin: " . $Server->Url() );
header("Access-Control-Allow-Headers: x-requested-with,x-request");
$valid = true;
}
}
if ( ! $valid ) {