Skip to content

Instantly share code, notes, and snippets.

@aleduca
Created October 5, 2022 11:13
Show Gist options
  • Save aleduca/aceacd62e4ff54fd41708fa6daef12fc to your computer and use it in GitHub Desktop.
Save aleduca/aceacd62e4ff54fd41708fa6daef12fc to your computer and use it in GitHub Desktop.
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT');
header('Access-Control-Allow-Headers:X-Requested-With, Content-Type');
if ('OPTIONS' === $_SERVER['REQUEST_METHOD']) {
die('error');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment