From 330a2de7228be25dfe9b2b48c1886dfa3dbf8604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 11 Dec 2017 20:00:39 +0100 Subject: [PATCH] Add a recipe for NelmioCorsBundle --- .../cors-bundle/1.5/config/packages/nelmio_cors.yaml | 9 +++++++++ nelmio/cors-bundle/1.5/manifest.json | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 nelmio/cors-bundle/1.5/config/packages/nelmio_cors.yaml create mode 100644 nelmio/cors-bundle/1.5/manifest.json diff --git a/nelmio/cors-bundle/1.5/config/packages/nelmio_cors.yaml b/nelmio/cors-bundle/1.5/config/packages/nelmio_cors.yaml new file mode 100644 index 00000000..0e04c0ba --- /dev/null +++ b/nelmio/cors-bundle/1.5/config/packages/nelmio_cors.yaml @@ -0,0 +1,9 @@ +nelmio_cors: + defaults: + origin_regex: true + allow_origin: ['%env(CORS_ALLOW_ORIGIN)%'] + allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'] + allow_headers: ['Content-Type', 'Authorization'] + max_age: 3600 + paths: + '^/': ~ diff --git a/nelmio/cors-bundle/1.5/manifest.json b/nelmio/cors-bundle/1.5/manifest.json new file mode 100644 index 00000000..7df4a31c --- /dev/null +++ b/nelmio/cors-bundle/1.5/manifest.json @@ -0,0 +1,12 @@ +{ + "bundles": { + "Nelmio\\CorsBundle\\NelmioCorsBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "CORS_ALLOW_ORIGIN": "^https?://localhost:?[0-9]*$" + }, + "aliases": ["cors"] +}