Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
fix: conflicting path
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 29, 2023
1 parent b819e68 commit 5c28bf2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ 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)
endless.ListenAndServe(os.Getenv("HOST")+":"+PORT, handler)
}

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{})

Expand Down

0 comments on commit 5c28bf2

Please sign in to comment.