Created
April 20, 2017 22:01
-
-
Save joshkoenig/ac3052b32518da0e1f1b851d4c5ecfca to your computer and use it in GitHub Desktop.
Don't serve OPTIONS responses. Ever.
This file contains 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 | |
// At the top of settings.php this snippit will short-cut any OPTIONS requests if you really don't want your CMS to be serving them. | |
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { | |
// At this point you may want to set more specific response headers, etc. | |
die('These are not the drones you seek.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment