put back CORS validity checking code
parent
644080fd41
commit
62adb756a9
|
@ -95,22 +95,20 @@ function noCacheHeaders()
|
||||||
}
|
}
|
||||||
|
|
||||||
function CORSHeaders() {
|
function CORSHeaders() {
|
||||||
# This just allows cross server requests with no verification. This is ok, because we do auth later.
|
|
||||||
header("Access-Control-Allow-Origin: *" );
|
|
||||||
|
|
||||||
# The following is left for future reference/use.
|
# The following is left for future reference/use.
|
||||||
#$valid = false;
|
$valid = false;
|
||||||
#header("Access-Control-Allow-Headers: x-requested-with,x-request");
|
foreach( dbFetchAll( 'SELECT * FROM Servers' ) as $row ) {
|
||||||
#foreach( dbFetchAll( 'SELECT * FROM Servers' ) as $row ) {
|
$Server = new Server( $row );
|
||||||
#$Server = new Server( $row );
|
if ( $_SERVER['HTTP_ORIGIN'] == $Server->Url() ) {
|
||||||
#if ( $_SERVER['HTTP_ORIGIN'] == $Server->Url() ) {
|
$valid = true;
|
||||||
#$valid = true;
|
header("Access-Control-Allow-Origin: " . $Server->Url() );
|
||||||
#header("Access-Control-Allow-Origin: " . $Server->Url() );
|
header("Access-Control-Allow-Headers: x-requested-with,x-request");
|
||||||
#}
|
}
|
||||||
#}
|
}
|
||||||
#if ( ! $valid ) {
|
if ( ! $valid ) {
|
||||||
#Warning( $_SERVER['HTTP_ORIGIN'] . " is not found in servers list." );
|
Warning( $_SERVER['HTTP_ORIGIN'] . " is not found in servers list." );
|
||||||
#}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAuthUser( $auth )
|
function getAuthUser( $auth )
|
||||||
|
|
Loading…
Reference in New Issue