From 384521a281abed9b230187794c868ffaebe71b4b Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Mon, 11 Mar 2019 02:33:01 +0000 Subject: [PATCH] Backend Service --- svrswww/api/users/index.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/svrswww/api/users/index.php b/svrswww/api/users/index.php index c1726c1..7df2013 100644 --- a/svrswww/api/users/index.php +++ b/svrswww/api/users/index.php @@ -5,6 +5,19 @@ THIS IS THE USER ENTRY POINT API require '../../backend.php'; require '../backend_defines.php'; //var_dump($mermsemr->cfgReadChar("database.host")); +if ($_SERVER['REQUEST_METHOD']=='OPTIONS') { + $headers = getallheaders(); + header('Access-Control-Allow-Origin: '.(isset($headers["Origin"])?$headers["Origin"]:'*')); + header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS'); + header('Access-Control-Allow-Headers: access-control-allow-methods,access-control-allow-origin,content-type'); + //header('Access-Control-Max-Age: 1728000'); + header('Content-Length: 0'); + header('Content-Type: text/plain'); + die(); +} +header('Access-Control-Allow-Headers: access-control-allow-methods,access-control-allow-origin,content-type'); +header('Access-Control-Allow-Origin: *'); +header('Content-Type: application/json'); $endpoints = array( 'createuser' => array('POST'),