use hardcoded list of mime types...

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 3 years ago
parent dccf4bd636
commit 72ea175925

@ -2,7 +2,6 @@ package gemini
import (
"gophi/core"
"mime"
"path"
)
@ -14,11 +13,17 @@ func getFileStatusMeta(p *core.Path) string {
return gemMimeType
}
// Get the file extension
// Get file extension
ext := path.Ext(p.Relative())
// Try get the mime type, or use default unknown (application octet-stream)
mimeType, ok := mimeTypes[ext]
if !ok {
mimeType = "application/octet-stream"
}
// Calculate mime type for extension
return mime.TypeByExtension(ext)
return mimeType
}
func buildRedirect(to string) []byte {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save