fix(AntiGateV2): match task type case-insensitively
This commit is contained in:
		@ -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"`
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user