Skip to content

A free open source IT asset/license management system

Cors should respect the .env var for CORS domains

Brady Wetheringtoncd2c92fd6cc3
diff --git a/config/cors.php b/config/cors.php
index f09ab4979f..083ee30934 100644
--- a/config/cors.php
+++ b/config/cors.php
@@ -1,10 +1,14 @@
<?php
+$allowed_origins = env('CORS_ALLOWED_ORIGINS') !== null ?
+ explode(',', env('CORS_ALLOWED_ORIGINS')) : [];
+
+
return [
'supportsCredentials' => false,
- 'allowedOrigins' => ['*'],
+ 'allowedOrigins' => $allowed_origins,
'allowedHeaders' => ['*'],