forked from sloum/bombadillo
Simplified gophertype fix for search response
This commit is contained in:
parent
2e964cc586
commit
bfa8a162e3
|
@ -95,9 +95,6 @@ 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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue