Skip to content

Commit 87efb2a

Browse files
committed
fix: enable credentials in CORS configuration for enhanced security
1 parent 34701c9 commit 87efb2a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

backend/cmd/server/main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ func main() {
181181

182182
// Security: CORS to allow frontend access
183183
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
184-
AllowOrigins: []string{"http://localhost:5173", "https://tibiacores.com", frontendURL},
185-
AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept, echo.HeaderAuthorization, "X-Request-ID"},
186-
AllowMethods: []string{echo.GET, echo.PUT, echo.POST, echo.DELETE, echo.OPTIONS},
187-
ExposeHeaders: []string{"X-Auth-Token"},
184+
AllowOrigins: []string{"http://localhost:5173", "https://tibiacores.com", frontendURL},
185+
AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept, echo.HeaderAuthorization, "X-Request-ID"},
186+
AllowMethods: []string{echo.GET, echo.PUT, echo.POST, echo.DELETE, echo.OPTIONS},
187+
AllowCredentials: true,
188+
ExposeHeaders: []string{"X-Auth-Token"},
188189
}))
189190

190191
// Security: Limit body size to prevent DoS (2MB limit)

0 commit comments

Comments
 (0)