|
|
|
@ -613,10 +613,7 @@ func (a *App) Layout(g *gocui.Gui) error {
|
|
|
|
|
setViewProperties(v, name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sv, _ := g.View(STATUSLINE_VIEW)
|
|
|
|
|
sv.BgColor = gocui.ColorDefault | gocui.AttrReverse
|
|
|
|
|
sv.FgColor = gocui.ColorDefault | gocui.AttrReverse
|
|
|
|
|
a.statusLine.Update(sv, a)
|
|
|
|
|
refreshStatusLine(a, g)
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
@ -1099,6 +1096,12 @@ func (a *App) SetKeys(g *gocui.Gui) error {
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
g.SetKeybinding(ALL_VIEWS, gocui.KeyF12, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
|
a.config.General.FollowRedirects = !a.config.General.FollowRedirects
|
|
|
|
|
refreshStatusLine(a, g)
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
g.SetKeybinding(REQUEST_METHOD_VIEW, gocui.KeyEnter, gocui.ModNone, a.ToggleMethodList)
|
|
|
|
|
|
|
|
|
|
cursDown := func(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
@ -1749,13 +1752,21 @@ func (a *App) InitConfig() {
|
|
|
|
|
MinVersion: a.config.General.TLSVersionMin,
|
|
|
|
|
MaxVersion: a.config.General.TLSVersionMax,
|
|
|
|
|
}
|
|
|
|
|
if !a.config.General.FollowRedirects {
|
|
|
|
|
CLIENT.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
|
|
|
|
|
return http.ErrUseLastResponse
|
|
|
|
|
CLIENT.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
|
|
|
|
|
if a.config.General.FollowRedirects {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return http.ErrUseLastResponse
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func refreshStatusLine(a *App, g *gocui.Gui) {
|
|
|
|
|
sv, _ := g.View(STATUSLINE_VIEW)
|
|
|
|
|
sv.BgColor = gocui.ColorDefault | gocui.AttrReverse
|
|
|
|
|
sv.FgColor = gocui.ColorDefault | gocui.AttrReverse
|
|
|
|
|
a.statusLine.Update(sv, a)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func initApp(a *App, g *gocui.Gui) {
|
|
|
|
|
g.Cursor = true
|
|
|
|
|
g.InputEsc = false
|
|
|
|
|