From 55878ce2e3903af5d7d98b915e709432a2163b47 Mon Sep 17 00:00:00 2001 From: Daniel Johnsen Date: Mon, 4 Nov 2024 14:53:24 +0100 Subject: [PATCH] fix: add CORS middleware --- deployment/kubernetes/deforestation-api.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deployment/kubernetes/deforestation-api.yaml b/deployment/kubernetes/deforestation-api.yaml index 7dcc898..9d11eb0 100644 --- a/deployment/kubernetes/deforestation-api.yaml +++ b/deployment/kubernetes/deforestation-api.yaml @@ -60,6 +60,19 @@ spec: forceSlash: true --- apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: cors-deforestation +spec: + headers: + accessControlAllowMethods: + - "GET" + accessControlAllowHeaders: + - "*" + accessControlAllowOriginList: + - "*" +--- +apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: deforestation-api @@ -75,4 +88,5 @@ spec: port: 80 middlewares: - name: stripprefix-deforestation + - name: cors-deforestation