Skip to content

Commit faee5ca

Browse files
committed
fix(#1329248): Fix nelmio_cors config and env variable CORS_ALLOW_ORIGIN not corectly configured in compose.yml
1 parent 8d8d906 commit faee5ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/config/packages/nelmio_cors.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
nelmio_cors:
22
defaults:
3+
allow_credentials: true
4+
allow_private_network: true
35
origin_regex: true
46
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
57
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
6-
allow_headers: ['Content-Type', 'Authorization', 'Preload', 'Fields']
8+
allow_headers: ['Accept', 'Accept-Language', 'Content-Type', 'Authorization', 'Preload', 'Fields', 'User-Agent', 'Priority', 'Pragma', 'Cache-Control']
79
expose_headers: ['Link']
810
max_age: 3600
911
paths:

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ services:
8282
- API_ROUTE_PREFIX=${API_ROUTE_PREFIX:-api}
8383
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
8484
- TRUSTED_HOSTS=${TRUSTED_HOSTS:-^${SERVER_NAME:-|gally.localhost}|localhost|php$$}
85-
- CORS_ALLOW_ORIGIN=^https?://${SERVER_NAME:-gally.localhost}$
85+
- CORS_ALLOW_ORIGIN=${CORS_ALLOW_ORIGIN:-^https?://${SERVER_NAME:-gally.localhost}$}
8686
- GALLY_CATALOG_MEDIA_URL=${GALLY_CATALOG_MEDIA_URL:-https://${SERVER_NAME:-gally.localhost}/media/catalog/product/}
8787
- DATABASE_URL=postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-16}&charset=${POSTGRES_CHARSET:-utf8}
8888
- ELASTICSEARCH_URL=https://${SEARCH_USER:-admin}:${SEARCH_PASSWORD:-!ChangeMe0!}@${SEARCH_HOST:-search}:9200/

0 commit comments

Comments
 (0)