From 3efde7d061da6f8256cff624c0c8c009dc8ea211 Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Mon, 28 Oct 2019 22:14:11 -0700 Subject: [PATCH] Fixes a glitch that was preventing redirects from getting shown in lynxmode --- http/lynx_mode.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/http/lynx_mode.go b/http/lynx_mode.go index d329d1d..3cc89ca 100644 --- a/http/lynx_mode.go +++ b/http/lynx_mode.go @@ -38,9 +38,16 @@ func IsTextFile(url string) bool { for _, header := range headers { if strings.Contains(header, "content-type:") && strings.Contains(header, "text") { return true + } else if strings.Contains(header, "content-type:") { + return false } } - return false + + // If we made it here, there is no content-type header. + // So in the event of the unknown, lets render to the + // screen. This will allow redirects to get rendered + // as well. + return true } func parseLinks(c string) page {