fix: CORS stuff

This commit is contained in:
2025-11-19 18:52:59 -07:00
parent 0100b8b6c5
commit 17f8f18574
3 changed files with 671 additions and 1035 deletions

View File

@@ -39,7 +39,7 @@ func main() {
// Configure CORS middleware
r.NoRoute(func(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:3000")
c.Writer.Header().Set("Access-Control-Allow-Origin", os.Getenv("ALLOWED_ORIGIN"))
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With")
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")