From 1a8ac737e52cb25a5c346232ee398f5908cee7d7 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 6 Jul 2020 08:04:35 +0200 Subject: Process main page (linklist) through Slim controller Including a bunch of improvements on the container, and helper used across new controllers. --- application/api/ApiMiddleware.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'application/api/ApiMiddleware.php') diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php index 4745ac94..09ce6445 100644 --- a/application/api/ApiMiddleware.php +++ b/application/api/ApiMiddleware.php @@ -71,7 +71,14 @@ class ApiMiddleware $response = $e->getApiResponse(); } - return $response; + return $response + ->withHeader('Access-Control-Allow-Origin', '*') + ->withHeader( + 'Access-Control-Allow-Headers', + 'X-Requested-With, Content-Type, Accept, Origin, Authorization' + ) + ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS') + ; } /** -- cgit v1.2.3