debug logs

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-19 19:59:02 -04:00
parent bee0301422
commit f0ffa57790
+19
View File
@@ -253,13 +253,32 @@ class WrenchApi extends BaseController
return $in;
}
public function apigate(){
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "0002");
/*
//header("Access-Control-Allow-Origin: http://localhost:9057 ");
header('Access-Control-Expose-Headers: Access-Control-Allow-Origin');
//header('Access-Control-Allow-Credentials: true ');
//header("Access-Control-Allow-Headers: Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With");
header('Access-Control-Allow-Headers :Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token');
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Content-type: application/json');
*/
header("Access-Control-Allow-Headers: Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token");
log_message('critical', "0003");
header("Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 3600");
header('content-type: application/json; charset=utf-8');
$method = $_SERVER['REQUEST_METHOD'];
if ($method == "OPTIONS") {
header("HTTP/1.1 200 OK CORS");
log_message('critical', " apigate()-> OPTIONS DIE*****" );
die();
}
//$request = service('request');
// what is the endpoint
$uri = urldecode(current_url(true));