Skip to content
Snippets Groups Projects
Commit b1bda989 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Add CORS support

parent 290a4053
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,32 @@ if (file_exists('config.inc.php')) {
require 'config.sample.php';
}
// Specify domains from which requests are allowed
header('Access-Control-Allow-Origin: *');
// Specify which request methods are allowed
header('Access-Control-Allow-Methods: GET');
// 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'){
exit();
}
$procure = new UNL_Procurement_Controller($_GET);
/*
?><pre><?php var_dump($procure);?></pre><?php
*/
Savvy_ClassToTemplateMapper::$classname_replacement = 'UNL_';
$savvy = new Savvy();
......@@ -35,4 +57,4 @@ if ($procure->actionable[0] instanceof UNL_Procurement_File) {
echo $savvy->render($procure->actionable[0], 'Procurement/File.tpl.php');
} else {
echo $savvy->render($procure);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment