From d8c779c030baa249570371247ff72a830b1ebdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 26 Dec 2022 12:12:00 +0800 Subject: [PATCH] wininet: skip set bypass list --- common/wininet/wininet_windows.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/wininet/wininet_windows.go b/common/wininet/wininet_windows.go index 0e3c8f1..0393d7c 100644 --- a/common/wininet/wininet_windows.go +++ b/common/wininet/wininet_windows.go @@ -102,6 +102,9 @@ func SetSystemProxy(proxy string, bypass string) error { var proxyOption internetPerConnOption proxyOption.dwOption = internetPerConnProxyServer *((*uintptr)(unsafe.Pointer(&proxyOption.value))) = uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(proxy))) + if bypass == "" { + return setOptions(flagsOption, proxyOption) + } var bypassOption internetPerConnOption bypassOption.dwOption = internetPerConnProxyBypass *((*uintptr)(unsafe.Pointer(&bypassOption.value))) = uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(bypass)))