Simplified gophertype fix for search response
This commit is contained in:
parent
2e964cc586
commit
bfa8a162e3
|
@ -95,10 +95,7 @@ func Visit(addr, openhttp string) (View, error) {
|
||||||
|
|
||||||
return View{}, fmt.Errorf("")
|
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)
|
text, err := Retrieve(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package gopher
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
//------------------------------------------------\\
|
//------------------------------------------------\\
|
||||||
|
@ -76,6 +77,10 @@ func MakeUrl(u string) (Url, error) {
|
||||||
out.Gophertype = "0"
|
out.Gophertype = "0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if out.Gophertype == "7" && strings.Contains(out.Resource, "\t") {
|
||||||
|
out.Gophertype = "1"
|
||||||
|
}
|
||||||
|
|
||||||
switch out.Gophertype {
|
switch out.Gophertype {
|
||||||
case "1", "0", "h", "7":
|
case "1", "0", "h", "7":
|
||||||
out.IsBinary = false
|
out.IsBinary = false
|
||||||
|
|
Loading…
Reference in New Issue