once we have found a match for our origin, break out of loop

This commit is contained in:
Isaac Connor 2018-09-14 14:56:26 -04:00
parent d9b1d3ec11
commit f1442eba90
1 changed files with 3 additions and 2 deletions

View File

@ -51,10 +51,11 @@ function CORSHeaders() {
$valid = true;
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Headers: x-requested-with,x-request');
break;
}
}
if ( ! $valid ) {
Warning( $_SERVER['HTTP_ORIGIN'] . ' is not found in servers list.' );
if ( !$valid ) {
Warning($_SERVER['HTTP_ORIGIN'] . ' is not found in servers list.');
}
}
}