From a9d76067ec82f7e94da549ee828623baec00b625 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Thu, 6 Jun 2024 15:30:13 +0200 Subject: [PATCH] fix: expose `X-Supabase-Api-Version` header in CORS --- internal/api/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index 2b139316a..85292775f 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -328,8 +328,8 @@ func NewAPIWithVersion(globalConfig *conf.GlobalConfiguration, db *storage.Conne corsHandler := cors.New(cors.Options{ AllowedMethods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}, - AllowedHeaders: globalConfig.CORS.AllAllowedHeaders([]string{"Accept", "Authorization", "Content-Type", "X-Client-IP", "X-Client-Info", audHeaderName, useCookieHeader}), - ExposedHeaders: []string{"X-Total-Count", "Link"}, + AllowedHeaders: globalConfig.CORS.AllAllowedHeaders([]string{"Accept", "Authorization", "Content-Type", "X-Client-IP", "X-Client-Info", audHeaderName, useCookieHeader, APIVersionHeaderName}), + ExposedHeaders: []string{"X-Total-Count", "Link", APIVersionHeaderName}, AllowCredentials: true, })