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)