File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func originRequestFromSingeRule(c *cli.Context) OriginRequestConfig {
4949 var noTLSVerify bool
5050 var disableChunkedEncoding bool
5151 var bastionMode bool
52- var proxyAddress string
52+ var proxyAddress = defaultProxyAddress
5353 var proxyPort uint
5454 var proxyType string
5555 if flag := ProxyConnectTimeoutFlag ; c .IsSet (flag ) {
Original file line number Diff line number Diff line change 11package ingress
22
33import (
4+ "flag"
45 "testing"
56 "time"
67
78 "github.com/cloudflare/cloudflared/cmd/cloudflared/config"
89 "github.com/stretchr/testify/require"
10+ "github.com/urfave/cli/v2"
911 "gopkg.in/yaml.v2"
1012)
1113
@@ -182,3 +184,19 @@ ingress:
182184 }
183185 require .Equal (t , expected1 , actual1 )
184186}
187+
188+ func TestDefaultConfigFromCLI (t * testing.T ) {
189+ set := flag .NewFlagSet ("contrive" , 0 )
190+ c := cli .NewContext (nil , set , nil )
191+
192+ expected := OriginRequestConfig {
193+ ConnectTimeout : defaultConnectTimeout ,
194+ TLSTimeout : defaultTLSTimeout ,
195+ TCPKeepAlive : defaultTCPKeepAlive ,
196+ KeepAliveConnections : defaultKeepAliveConnections ,
197+ KeepAliveTimeout : defaultKeepAliveTimeout ,
198+ ProxyAddress : defaultProxyAddress ,
199+ }
200+ actual := originRequestFromSingeRule (c )
201+ require .Equal (t , expected , actual )
202+ }
You can’t perform that action at this time.
0 commit comments