Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joshkoenig
Created April 20, 2017 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshkoenig/ac3052b32518da0e1f1b851d4c5ecfca to your computer and use it in GitHub Desktop.
Save joshkoenig/ac3052b32518da0e1f1b851d4c5ecfca to your computer and use it in GitHub Desktop.
Don't serve OPTIONS responses. Ever.
<?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