Support reverse proxy's real IP header

This commit is contained in:
2023-01-17 21:01:29 +08:00
parent a2e5b9d24d
commit 13b303ea3f
3 changed files with 29 additions and 9 deletions

View File

@@ -26,10 +26,6 @@ import (
)
func InitRouters(router *gin.Engine, db *gorm.DB, meta *ServerMeta, skinRootUrl string) {
err := router.SetTrustedProxies([]string{"127.0.0.1"})
if err != nil {
panic(err)
}
router.Use(cors.New(cors.Config{
AllowAllOrigins: true,
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "HEAD"},