diff --git a/web/includes/functions.php b/web/includes/functions.php index 364dc9cee..8cc3f606f 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -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 ) {