mirror of
https://github.com/asciimoo/wuzz
synced 2024-11-10 13:10:29 +00:00
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
|
||||
|
4
wuzz.go
4
wuzz.go
@ -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…
Reference in New Issue
Block a user