From c55ae178b416a17546f267b41dcc8c520df50388 Mon Sep 17 00:00:00 2001 From: arzumify Date: Wed, 5 Feb 2025 16:32:08 +0000 Subject: [PATCH] Patched it for some apple devices pretending to be chromium --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 7e6e3d7..8642fee 100644 --- a/main.go +++ b/main.go @@ -655,7 +655,8 @@ func Get(url string) (response *Response, err error) { if err != nil { return } - if !strings.HasPrefix(url, "https://") && !js.Global().Get("chrome").IsUndefined() { + // Disable if not https, we don't detect chromium, or we are on safari + if !strings.HasPrefix(url, "https://") || !js.Global().Get("chrome").IsUndefined() || strings.Contains(js.Global().Get("navigator").Get("userAgent").String(), "Safari") { request.DisableStreamedClient = true } response, err = Fetch.Do(request) @@ -671,7 +672,8 @@ func Post(url string, contentType string, body io.Reader) (response *Response, e if err != nil { return } - if !strings.HasPrefix(url, "https://") && !js.Global().Get("chrome").IsUndefined() { + // Disable if not https, we don't detect chromium, or we are on safari + if !strings.HasPrefix(url, "https://") || !js.Global().Get("chrome").IsUndefined() || strings.Contains(js.Global().Get("navigator").Get("userAgent").String(), "Safari") { request.DisableStreamedClient = true } request.Header.Add("Content-Type", contentType) @@ -690,7 +692,8 @@ func PostForm(url string, data url.Values) (response *Response, err error) { return } request.Header.Add("Content-Type", "application/x-www-form-urlencoded") - if !strings.HasPrefix(url, "https://") && !js.Global().Get("chrome").IsUndefined() { + // Disable if not https, we don't detect chromium, or we are on safari + if !strings.HasPrefix(url, "https://") || !js.Global().Get("chrome").IsUndefined() || strings.Contains(js.Global().Get("navigator").Get("userAgent").String(), "Safari") { request.DisableStreamedClient = true } response, err = Fetch.Do(request)