Merge pull request 'Adds default mime per gemini spec' (#183) from mime-fix into release2.3.2
Reviewed-on: #183
This commit is contained in:
commit
953ae8e28f
|
@ -331,6 +331,9 @@ func Visit(host, port, resource string, td *TofuDigest) (Capsule, error) {
|
|||
case 2:
|
||||
mimeAndCharset := strings.Split(header[1], ";")
|
||||
meta = mimeAndCharset[0]
|
||||
if meta == "" {
|
||||
meta = "text/gemini"
|
||||
}
|
||||
minMajMime := strings.Split(meta, "/")
|
||||
if len(minMajMime) < 2 {
|
||||
return capsule, fmt.Errorf("Improperly formatted mimetype received from server")
|
||||
|
|
Loading…
Reference in New Issue