]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/api/ApiMiddleware.php
Process main page (linklist) through Slim controller
[github/shaarli/Shaarli.git] / application / api / ApiMiddleware.php
index 4745ac94101db8efb3c83bc760dd154a3af0445e..09ce6445303bf5f9280e033c6004bf5e56f725c9 100644 (file)
@@ -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')
+        ;
     }
 
     /**