From 5c28bf2ee467b1f30fd640b8eaadca0e545e5ab4 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 29 Jun 2023 16:51:57 +0800 Subject: [PATCH] fix: conflicting path --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 4a370cb..fad6afb 100644 --- a/main.go +++ b/main.go @@ -131,12 +131,6 @@ func main() { os.Setenv("OPENAI_EMAIL", authorizations.OpenAI_Email) os.Setenv("OPENAI_PASSWORD", authorizations.OpenAI_Password) }) - - handler.GET("/api/arkose", func(ctx *gin.Context) { - arkose_form := arkose.GetForm() - ctx.JSON(200, gin.H{"form": arkose_form}) - }) - handler.Any("/api/*path", proxy) gin.SetMode(gin.ReleaseMode) @@ -144,6 +138,12 @@ func main() { } func proxy(c *gin.Context) { + if c.Request.URL.Path == "/api/arkose" { + arkose_form := arkose.GetForm() + c.JSON(200, gin.H{"form": arkose_form}) + return + } + // Remove _cfuvid cookie from session jar.SetCookies(c.Request.URL, []*http.Cookie{})