summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-05-09 11:36:31 -0600
committertjpcc <tjp@ctrl-c.club>2023-05-09 11:36:52 -0600
commit8110ecaf4009cf97a35661dced642b260ff63282 (patch)
treeecc3b0c6c97f9797a093cb3130377b0a7beee239
parentc754a4406455936dd8ab6d0278fc6423f2fbf2cc (diff)
correctly use path.Ext() results
-rw-r--r--contrib/fs/gopher.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/fs/gopher.go b/contrib/fs/gopher.go
index dc5b312..e902b4e 100644
--- a/contrib/fs/gopher.go
+++ b/contrib/fs/gopher.go
@@ -133,31 +133,31 @@ i {{ $hostname }} {{ $port }}
func GuessGopherItemType(filepath string) sr.Status {
ext := path.Ext(filepath)
switch ext {
- case "gophermap":
+ case ".gophermap":
return gopher.MenuType
- case "txt", "gmi":
+ case ".txt", ".gmi":
return gopher.TextFileType
- case "gif", "png", "jpg", "jpeg":
+ case ".gif", ".png", ".jpg", ".jpeg":
return gopher.ImageFileType
- case "mp4", "mov":
+ case ".mp4", ".mov":
return gopher.MovieFileType
- case "mp3", "aiff", "aif", "aac", "ogg", "flac", "alac", "wma":
+ case ".mp3", ".aiff", ".aif", ".aac", ".ogg", ".flac", ".alac", ".wma":
return gopher.SoundFileType
- case "bmp":
+ case ".bmp":
return gopher.BitmapType
- case "doc", "docx", "odt":
+ case ".doc", ".docx", ".odt":
return gopher.DocumentType
- case "html", "htm":
+ case ".html", ".htm":
return gopher.HTMLType
- case "rtf":
+ case ".rtf":
return gopher.RtfDocumentType
- case "wav":
+ case ".wav":
return gopher.WavSoundFileType
- case "pdf":
+ case ".pdf":
return gopher.PdfDocumentType
- case "xml":
+ case ".xml":
return gopher.XmlDocumentType
- case "":
+ case ".":
return gopher.BinaryFileType
}