From f85048c01692d8c3b241669fe4b53f18d40ae01b Mon Sep 17 00:00:00 2001 From: Cyberes Date: Mon, 29 Jul 2024 16:36:54 -0600 Subject: [PATCH] don't check for chrome binary binary when impersonate is disabled --- src/config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config/config.go b/src/config/config.go index afd91d1..7fd336b 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -95,8 +95,10 @@ func SetConfig(configFile string) (*Config, error) { return nil, proxyPoolThirdpartyErr } - if _, err := os.Stat(config.ProxyCheckImpersonateChromeBinary); os.IsNotExist(err) { - return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary does not exist: "%s"`, config.ProxyCheckImpersonateChromeBinary)) + if config.ProxyCheckImpersonateChrome { + if _, err := os.Stat(config.ProxyCheckImpersonateChromeBinary); os.IsNotExist(err) { + return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary does not exist: "%s"`, config.ProxyCheckImpersonateChromeBinary)) + } } cmd := exec.Command(config.ProxyCheckImpersonateChromeBinary, "--help") err = cmd.Run()