fix: rename insecureSkipVerify to insecure for consistency

This commit is contained in:
Toby 2024-12-29 11:25:08 -08:00
parent 2bdaf7b46a
commit 8aa80c233e
4 changed files with 9 additions and 8 deletions

View file

@ -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 {
@ -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,

View file

@ -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",

View file

@ -132,7 +132,7 @@ masquerade:
proxy:
url: https://some.site.net
rewriteHost: true
insecureSkipVerify: true
insecure: true
string:
content: aint nothin here
headers: