Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 1616c6800d
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (34 sloc) 1.25 KB
// CORS allows HTML5 apps running in modern browsers
// to make valid cross-origin requests.
// For more on CORS, see
// This PHP module sets the appropriate headers in the webserver
// response, to tell browsers that it's ok to connect to
// directly from script.
// Another way to add this header is to do so via Webserver
// configuration. You can use one or the other, but you do not need
// both.
// NB: This file will work only on webservers that have PHP enabled.
// Specify domains from which requests are allowed
// Specify which request methods are allowed
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
// Additional headers which may be sent along with the CORS request
// The X-Requested-With header allows jQuery requests to go through
header('Access-Control-Allow-Headers: X-Requested-With');
// Set the age to 1 day to improve speed/caching.
header('Access-Control-Max-Age: 86400');
// Exit early so the page isn't fully loaded for options requests
if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') {
// delegate to the view
include './index.html';
Jump to Line
Something went wrong with that request. Please try again.