This commit is contained in:
rxdn 2021-07-30 18:40:19 +01:00
parent 274481bc77
commit 412f140d34
2 changed files with 8 additions and 2 deletions

View File

@ -13,7 +13,6 @@ import (
func MultiPanelDelete(ctx *gin.Context) { func MultiPanelDelete(ctx *gin.Context) {
guildId := ctx.Keys["guildid"].(uint64) guildId := ctx.Keys["guildid"].(uint64)
ctx.ClientIP()
multiPanelId, err := strconv.Atoi(ctx.Param("panelid")) multiPanelId, err := strconv.Atoi(ctx.Param("panelid"))
if err != nil { if err != nil {

View File

@ -1,6 +1,7 @@
package http package http
import ( import (
"fmt"
"github.com/TicketsBot/GoPanel/app/http/endpoints/api" "github.com/TicketsBot/GoPanel/app/http/endpoints/api"
api_autoclose "github.com/TicketsBot/GoPanel/app/http/endpoints/api/autoclose" api_autoclose "github.com/TicketsBot/GoPanel/app/http/endpoints/api/autoclose"
api_blacklist "github.com/TicketsBot/GoPanel/app/http/endpoints/api/blacklist" api_blacklist "github.com/TicketsBot/GoPanel/app/http/endpoints/api/blacklist"
@ -31,7 +32,7 @@ func StartServer() {
router := gin.Default() router := gin.Default()
router.RemoteIPHeaders = append(router.RemoteIPHeaders, "CF-Connecting-IP") router.RemoteIPHeaders = append(router.RemoteIPHeaders, "X-Forwarded-For", "X-Real-IP", "CF-Connecting-IP")
if err := router.SetTrustedProxies(config.Conf.Server.TrustedProxies); err != nil { if err := router.SetTrustedProxies(config.Conf.Server.TrustedProxies); err != nil {
panic(err) panic(err)
} }
@ -47,6 +48,12 @@ func StartServer() {
router.Use(middleware.Cors(config.Conf)) router.Use(middleware.Cors(config.Conf))
router.Use(func(ctx *gin.Context) {
fmt.Println(ctx.Request.Header)
fmt.Println(ctx.ClientIP())
fmt.Println(ctx.RemoteIP())
})
router.GET("/webchat", root.WebChatWs) router.GET("/webchat", root.WebChatWs)
router.POST("/callback", middleware.VerifyXTicketsHeader, root.CallbackHandler) router.POST("/callback", middleware.VerifyXTicketsHeader, root.CallbackHandler)