fix: Restrict CORS to specific origins for enhanced security
Deploy Application / deploy (push) Successful in 18s Details

This commit is contained in:
Habib Fatkhul Rohman 2025-10-28 15:08:09 +07:00
parent 02fff69d2e
commit 1300108c41
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import (
func CORSMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Origin", "http://localhost:3000, https://wms.avolut.com")
c.Header("Access-Control-Allow-Credentials", "true")
c.Header("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With")
c.Header("Access-Control-Allow-Methods", "POST, HEAD, PATCH, OPTIONS, GET, PUT, DELETE")