Fix bug: #38 about lobechat cors policy

Relax CORS policy by allowing all headers in API responses
This commit is contained in:
Luis Pater
2025-09-08 23:36:43 +08:00
parent 99c9f3069c
commit 7353bc0b2b

View File

@@ -279,7 +279,7 @@ func corsMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
c.Header("Access-Control-Allow-Headers", "Origin, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
c.Header("Access-Control-Allow-Headers", "*")
if c.Request.Method == "OPTIONS" {
c.AbortWithStatus(http.StatusNoContent)