fs: Don't panic on mime.AddExtensionType error
It's probably best not to panic if this fails.
This commit is contained in:
parent
8473f3b9d4
commit
ad18ae601c
9
fs.go
9
fs.go
@ -10,13 +10,8 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Add Gemini mime types
|
// Add Gemini mime types
|
||||||
if err := mime.AddExtensionType(".gmi", "text/gemini"); err != nil {
|
mime.AddExtensionType(".gmi", "text/gemini")
|
||||||
panic(fmt.Errorf("failed to register .gmi extension mimetype: %w", err))
|
mime.AddExtensionType(".gemini", "text/gemini")
|
||||||
}
|
|
||||||
|
|
||||||
if err := mime.AddExtensionType(".gemini", "text/gemini"); err != nil {
|
|
||||||
panic(fmt.Errorf("failed to register .gemini extension mimetype: %w", err))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileServer takes a filesystem and returns a Responder which uses that filesystem.
|
// FileServer takes a filesystem and returns a Responder which uses that filesystem.
|
||||||
|
Loading…
Reference in New Issue
Block a user