git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@46 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2016-01-12 17:10:44 +00:00
parent b64172c2e9
commit b371156b94
3 changed files with 7 additions and 1 deletions
+5
View File
@@ -21,13 +21,18 @@ $app->hook('slim.before.router', function () use ($app, $allowedHost) {
if(!in_array($currentRefererRequest, $allowedHost))
{
$app->halt(500, "Generic error occurred");
return;
}
$currentHostRequest = $app->request()->getHost();
if(!in_array($currentHostRequest, $allowedHost))
{
$app->halt(403, "Request arrive from host not allowed " . $currentHostRequest );
return;
}
if(isset($_SERVER['HTTP_ORIGIN']))
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
});