Skip to content

Commit 9fba37a

Browse files
fix: accept clientURL param in CORS middleware, remove hardcoded origin
1 parent c5543ca commit 9fba37a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • backend/internal/middleware/cors

backend/internal/middleware/cors/cors.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import
55

66
)
77

8-
func CORS(next http.Handler) http.Handler {
8+
func CORS(next http.Handler, clientURL string) http.Handler {
99

1010
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
11-
url:="https://scintillating-commitment-production-2429.up.railway.app/"
12-
w.Header().Set("Access-Control-Allow-Origin", url)
11+
w.Header().Set("Access-Control-Allow-Origin", clientURL)
1312

1413
w.Header().Set("Access-Control-Allow-Credentials", "true")
1514

0 commit comments

Comments
 (0)