Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $allowedIn = array("http://this.site.org", "https://this.site.org", "http://that.site.org", "https://that.site.org");
- if(in_array($_SERVER['HTTP_ORIGIN'], $allowedIn)){
- $CORS = $allowedIn[array_search($_SERVER['HTTP_ORIGIN'], $allowedIn)];
- header("Access-Control-Allow-Origin: " . $CORS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement