Last active
June 28, 2019 20:44
-
-
Save vielhuber/e5e320aee847a0ea457ad6853fd58988 to your computer and use it in GitHub Desktop.
CORS enable with pure #php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS'); | |
header('Access-Control-Allow-Headers: X-Requested-With, Content-Type, Authorization'); | |
if(@$_SERVER['REQUEST_METHOD'] == 'OPTIONS') { die(); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment