From fe0a5e9810a3ced549083e6bd35fc7cae51e1047 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 26 Nov 2019 17:14:40 +0100 Subject: [PATCH] [fix] add redirect toggle command - fixes #121 --- commands.go | 6 ++++++ config/config.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 6bf0019..f312896 100644 --- a/commands.go +++ b/commands.go @@ -113,6 +113,12 @@ var COMMANDS map[string]func(string, *App) CommandFunc = map[string]func(string, return nil } }, + "redirectRestriction": func(_ string, a *App) CommandFunc { + return func(g *gocui.Gui, _ *gocui.View) error { + a.config.General.FollowRedirects = !a.config.General.FollowRedirects + return nil + } + }, } func scrollView(v *gocui.View, dy int) error { diff --git a/config/config.go b/config/config.go index c60dbcd..7e1abca 100644 --- a/config/config.go +++ b/config/config.go @@ -74,7 +74,7 @@ var DefaultKeys = map[string]map[string]string{ "F7": "focus search", "F8": "focus response-headers", "F9": "focus response-body", - "F12": "redirects restriction mode", + "F12": "redirectRestriction", }, "url": { "Enter": "submit",