gin-contrib / cors

Official CORS gin's middleware
https://gin-gonic.github.io/gin/
MIT License
1.77k stars 181 forks source link

Allow All Headers #118

Open g-harshit opened 1 year ago

g-harshit commented 1 year ago
corsConfig = cors.DefaultConfig()
corsConfig.AllowOrigins = []string{"http://localhost:3000"}
corsConfig.AllowCredentials = true
corsConfig.AddAllowHeaders("Authorization") // Add any additional headers you need to allow
corsConfig.AddAllowHeaders("UserID")
corsConfig.AddAllowHeaders("UserType")

We are adding one one Headers manually like UserID and UserType. Can we don something that all the headers are allowed by default.