diff --git a/gopher/gopher.go b/gopher/gopher.go index 21b7d02..82bedea 100644 --- a/gopher/gopher.go +++ b/gopher/gopher.go @@ -95,10 +95,7 @@ func Visit(addr, openhttp string) (View, error) { return View{}, fmt.Errorf("") } - } else if u.Gophertype == "7" && strings.Contains(u.Resource, "\t") { - u.Gophertype = "1" - u.Full = u.Scheme + "://" + u.Host + ":" + u.Port + "/" + u.Gophertype + u.Resource - } + } text, err := Retrieve(u) if err != nil { diff --git a/gopher/url.go b/gopher/url.go index cb80f2a..c94f020 100644 --- a/gopher/url.go +++ b/gopher/url.go @@ -3,6 +3,7 @@ package gopher import ( "errors" "regexp" + "strings" ) //------------------------------------------------\\ @@ -76,6 +77,10 @@ func MakeUrl(u string) (Url, error) { out.Gophertype = "0" } + if out.Gophertype == "7" && strings.Contains(out.Resource, "\t") { + out.Gophertype = "1" + } + switch out.Gophertype { case "1", "0", "h", "7": out.IsBinary = false