From b2dda4afbcc1eb7c70abce80fc67a0cab75712c8 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 12 Sep 2024 23:17:41 +0200 Subject: [PATCH] do not apply proxy if discard option is set --- proxy/util.go | 4 ++-- util/types.go | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/proxy/util.go b/proxy/util.go index 4082b3f..bb74169 100644 --- a/proxy/util.go +++ b/proxy/util.go @@ -26,8 +26,8 @@ func readArgs(replaceVariable bool, args []string, configCmd string) ([]string, } func applyProxy(configArgs []string, configCmd, proxyServer string, variant *util.Variant) ([]string, string) { - // Skip, no proxy provided - if proxyServer == "" { + // Skip, no proxy provided or proxy option discarded + if proxyServer == "" || variant.DiscardProxy { return configArgs, configCmd } diff --git a/util/types.go b/util/types.go index 87195c5..5c87de4 100644 --- a/util/types.go +++ b/util/types.go @@ -15,9 +15,10 @@ const ( ) type Variant struct { - Arguments []string `json:"args"` - Type VariantType `json:"type,omitempty"` - Equator string `json:"equator,omitempty"` + Arguments []string `json:"args"` + Type VariantType `json:"type,omitempty"` + Equator string `json:"equator,omitempty"` + DiscardProxy bool `json:"discard,omitempty"` } type Command struct {