From 025d73fe4a3012352e1ff5af27a280c2002d70f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Tue, 20 Feb 2024 12:15:56 +0100 Subject: [PATCH] [#224] Enable CORS for localhost This is a pre-step before implementing an exception that will be applied only to dev environment. This update facilitates easier development and testing by allowing local frontend applications to communicate with the backend without CORS restrictions. For development purposes, Cross-Origin Resource Sharing (CORS) settings have been updated to include `localhost` in the list of allowed origins. In next step the configuration for different environments will be stated explicite in target docjer-compose file. --- scripts/govtool/docker-compose.sanchonet.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/govtool/docker-compose.sanchonet.yml b/scripts/govtool/docker-compose.sanchonet.yml index 5c052a02d..7c85b506f 100644 --- a/scripts/govtool/docker-compose.sanchonet.yml +++ b/scripts/govtool/docker-compose.sanchonet.yml @@ -182,8 +182,10 @@ services: - "traefik.enable=true" - "traefik.http.routers.backend.rule=Host(`${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}`) && PathPrefix(`/api`)" - "traefik.http.middlewares.backend-stripprefix.stripprefix.prefixes=/api" - - "traefik.http.middlewares.backend-cors.headers.customresponseheaders.Access-Control-Allow-Origin=https://${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}" - - "traefik.http.middlewares.backend-cors.headers.customresponseheaders.Access-Control-Allow-Methods=GET,HEAD,OPTIONS" + - "traefik.http.middlewares.backend-cors.headers.accesscontrolallowmethods=GET,HEAD,OPTIONS" + - "traefik.http.middlewares.backend-cors.headers.accesscontrolallowheaders=*" + - "traefik.http.middlewares.backend-cors.headers.accesscontrolalloworiginlist=https://${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network},http://localhost" + - "traefik.http.middlewares.backend-cors.headers.accesscontrolmaxage=100" - "traefik.http.middlewares.backend-cors.headers.addvaryheader=true" - "traefik.http.routers.backend.middlewares=backend-stripprefix@docker,backend-cors@docker" - "traefik.http.routers.backend.entrypoints=websecure"