You should check if the request is a preflight ($_SERVER['REQUEST_METHOD'] == "OPTIONS") and just send a 200 status code
$_SERVER['REQUEST_METHOD'] == "OPTIONS"