Skip to content

Commit

Permalink
Add Cors for dev environments
Browse files Browse the repository at this point in the history
  • Loading branch information
PapsOu committed May 15, 2018
1 parent 1b06fc8 commit 7ed7964
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ CUSTOMER_DATABASE_URL=${DBDRIVER}://${DBCUSTOMERUSER}:${DBCUSTOMERPASSWORD}@${DB

###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN=^https?://localhost:?[0-9]*$
CORS_ALLOW_ORIGIN_DEV=^https?://localhost:?[0-9]*$
###< nelmio/cors-bundle ###
4 changes: 2 additions & 2 deletions config/packages/nelmio_cors.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%','%env(CORS_ALLOW_ORIGIN_DEV)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
max_age: 86400 # 24 hours
paths:
'^/pias':
allow_credentials: false
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%','%env(CORS_ALLOW_ORIGIN_DEV)%']
allow_headers: ['Content-Type', 'Authorization']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
max_age: 86400 # 24 hours

0 comments on commit 7ed7964

Please sign in to comment.