Merge pull request #54 from zbb93/master

#49 - Ignore Invalid SSL Cert
pull/55/head
Adam Tauber 7 years ago committed by GitHub
commit 41c62a88bf

@ -31,6 +31,7 @@ type Config struct {
type GeneralOptions struct {
Timeout Duration
FormatJSON bool
Insecure bool
PreserveScrollPosition bool
DefaultURLScheme string
}
@ -43,6 +44,7 @@ var DefaultConfig = Config{
defaultTimeoutDuration,
},
FormatJSON: true,
Insecure: false,
PreserveScrollPosition: true,
DefaultURLScheme: "https",
},

@ -4,3 +4,4 @@ timeout = "1m"
defaultURLScheme = "https"
formatJSON = true
preserveScrollPosition = true
insecure = false

@ -21,6 +21,7 @@ import (
"github.com/asciimoo/wuzz/config"
"crypto/tls"
"github.com/jroimartin/gocui"
"github.com/mattn/go-runewidth"
)
@ -920,6 +921,8 @@ func (a *App) ParseArgs(g *gocui.Gui, args []string) error {
if strings.Index(getViewValue(g, "headers"), "Accept-Encoding") == -1 {
fmt.Fprintln(vh, "Accept-Encoding: gzip, deflate")
}
case "--insecure":
a.config.General.Insecure = true
default:
u := args[arg_index]
if strings.Index(u, "http://") != 0 && strings.Index(u, "https://") != 0 {
@ -952,6 +955,7 @@ func (a *App) ParseArgs(g *gocui.Gui, args []string) error {
// args can override the provided config values
func (a *App) InitConfig() {
CLIENT.Timeout = a.config.General.Timeout.Duration
TRANSPORT.TLSClientConfig = &tls.Config{InsecureSkipVerify: a.config.General.Insecure}
}
func initApp(a *App, g *gocui.Gui) {

Loading…
Cancel
Save