From e47a96a597f400319477f23f59b759442d968361 Mon Sep 17 00:00:00 2001 From: "sati.ac" Date: Thu, 13 Jul 2023 23:20:38 +0300 Subject: [PATCH] fix(AntiGateV2): match task type case-insensitively --- api/AntiGateV2.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/AntiGateV2.go b/api/AntiGateV2.go index 4b6c013..88a9813 100644 --- a/api/AntiGateV2.go +++ b/api/AntiGateV2.go @@ -5,6 +5,7 @@ import ( "io" "net/http" "reflect" + "strings" "git.sati.ac/sati.ac/sati-go" "github.com/mitchellh/mapstructure" @@ -147,8 +148,8 @@ func (a *antigateV2Api) createTask(request struct { var id uint32 - switch taskType { - case "TurnstileTask", "TurnstileTaskProxyless": + switch strings.ToLower(taskType) { + case "turnstiletask", "turnstiletaskproxyless": var task struct { WebsiteURL string `json:"websiteURL"` WebsiteKey string `json:"websiteKey"` @@ -160,7 +161,7 @@ func (a *antigateV2Api) createTask(request struct { SiteKey: task.WebsiteKey, Action: task.Action, }) - case "RecaptchaV2Task", "RecaptchaV2TaskProxyless": + case "recaptchav2task", "recaptchav2taskproxyless": var task struct { WebsiteURL string `json:"websiteURL"` WebsiteKey string `json:"websiteKey"` @@ -170,7 +171,7 @@ func (a *antigateV2Api) createTask(request struct { PageUrl: task.WebsiteURL, SiteKey: task.WebsiteKey, }) - case "FunCaptchaTask", "FunCaptchaTaskProxyless": + case "funcaptchatask", "funcaptchataskproxyless": var task struct { WebsiteURL string `json:"websiteURL"` WebsitePublicKey string `json:"websitePublicKey"`