Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
e2ef035c39
|
@@ -165,7 +165,7 @@ func (f *Flaresolverr) DetermineProfile(userAgent string) profiles.ClientProfile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flaresolverr) simulateRequest(method string, url string, ua string, cookies []*http.Cookie, body *io.Reader, opts ...tls_client.HttpClientOption) (*fhttp.Response, error) {
|
func (f *Flaresolverr) simulateRequest(method string, url string, ua string, cookies []*http.Cookie, body io.Reader, opts ...tls_client.HttpClientOption) (*fhttp.Response, error) {
|
||||||
currentUA := ua
|
currentUA := ua
|
||||||
currentCookies := cookies
|
currentCookies := cookies
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ func (f *Flaresolverr) simulateRequest(method string, url string, ua string, coo
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create client: %w", err)
|
return nil, fmt.Errorf("failed to create client: %w", err)
|
||||||
}
|
}
|
||||||
req, err := fhttp.NewRequest(method, url, *body)
|
req, err := fhttp.NewRequest(method, url, body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create request: %w", err)
|
return nil, fmt.Errorf("failed to create request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -259,5 +259,5 @@ func (f *Flaresolverr) SimulateGet(url string, ua string, cookies []*http.Cookie
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flaresolverr) SimulatePost(url string, ua string, cookies []*http.Cookie, body io.Reader, opts ...tls_client.HttpClientOption) (*fhttp.Response, error) {
|
func (f *Flaresolverr) SimulatePost(url string, ua string, cookies []*http.Cookie, body io.Reader, opts ...tls_client.HttpClientOption) (*fhttp.Response, error) {
|
||||||
return f.simulateRequest("POST", url, ua, cookies, &body, opts...)
|
return f.simulateRequest("POST", url, ua, cookies, body, opts...)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user