This commit is contained in:
Nite07 2024-12-13 21:04:42 +08:00
parent d34ae73997
commit d4ed8594b7

View File

@ -3,7 +3,6 @@ package ccs
import (
"encoding/json"
"errors"
"strings"
"time"
"github.com/Danny-Dasilva/CycleTLS/cycletls"
@ -146,14 +145,9 @@ func RequestWithWAFSession(method string, URL string, wafSession Session, option
options = &cycletls.Options{}
}
headers := map[string]string{}
cookies := []string{}
for _, cookie := range wafSession.Cookies {
cookies = append(cookies, cookie.Name+"="+cookie.Value)
}
for key, value := range wafSession.Headers {
headers[key] = value
}
headers["Cookie"] = strings.Join(cookies, "; ")
options.Ja3 = "772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,23-27-65037-43-51-45-16-11-13-17513-5-18-65281-0-10-35,25497-29-23-24,0"
options.UserAgent = headers["user-agent"]
@ -165,6 +159,16 @@ func RequestWithWAFSession(method string, URL string, wafSession Session, option
options.Headers[key] = value
}
if options.Cookies == nil {
options.Cookies = []cycletls.Cookie{}
}
for _, cookie := range wafSession.Cookies {
options.Cookies = append(options.Cookies, cycletls.Cookie{
Name: cookie.Name,
Value: cookie.Value,
})
}
resp, err := cycletlsClient.Do(URL, *options, method)
if err != nil {
return resp, err