Skip to content

Commit

Permalink
fix: rename insecureSkipVerify to insecure for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Dec 29, 2024
1 parent 2bdaf7b commit 8aa80c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ type serverConfigMasqueradeFile struct {
}

type serverConfigMasqueradeProxy struct {
URL string `mapstructure:"url"`
RewriteHost bool `mapstructure:"rewriteHost"`
InsecureSkipVerify bool `mapstructure:"insecureSkipVerify"`
URL string `mapstructure:"url"`
RewriteHost bool `mapstructure:"rewriteHost"`
Insecure bool `mapstructure:"insecure"`
}

type serverConfigMasqueradeString struct {
Expand Down Expand Up @@ -812,7 +812,7 @@ func (c *serverConfig) fillMasqHandler(hyConfig *server.Config) error {
return configError{Field: "masquerade.proxy.url", Err: fmt.Errorf("unsupported protocol scheme \"%s\"", u.Scheme)}
}
transport := http.DefaultTransport
if c.Masquerade.Proxy.InsecureSkipVerify {
if c.Masquerade.Proxy.Insecure {
transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
Expand Down
6 changes: 3 additions & 3 deletions app/cmd/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ func TestServerConfig(t *testing.T) {
Dir: "/www/masq",
},
Proxy: serverConfigMasqueradeProxy{
URL: "https://some.site.net",
RewriteHost: true,
InsecureSkipVerify: true,
URL: "https://some.site.net",
RewriteHost: true,
Insecure: true,
},
String: serverConfigMasqueradeString{
Content: "aint nothin here",
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/server_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ masquerade:
proxy:
url: https://some.site.net
rewriteHost: true
insecureSkipVerify: true
insecure: true
string:
content: aint nothin here
headers:
Expand Down
1 change: 1 addition & 0 deletions core/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
Expand Down

0 comments on commit 8aa80c2

Please sign in to comment.