aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-24 14:27:49 -0500
committerAdnan Maolood <[email protected]>2021-02-24 14:27:49 -0500
commit6181751e8d33272276f5038927f6ac85c0de23b5 (patch)
tree016505446444794e496abde5907669af2376e774
parentReplace uses of ioutil with io (diff)
downloadgo-gemini-6181751e8d33272276f5038927f6ac85c0de23b5.tar.xz
go-gemini-6181751e8d33272276f5038927f6ac85c0de23b5.zip
Move mimetype registration to gemini.go
-rw-r--r--fs.go6
-rw-r--r--gemini.go6
2 files changed, 6 insertions, 6 deletions
diff --git a/fs.go b/fs.go
index 4ef515c..5e2841c 100644
--- a/fs.go
+++ b/fs.go
@@ -13,12 +13,6 @@ import (
"strings"
)
-func init() {
- // Add Gemini mime types
- mime.AddExtensionType(".gmi", "text/gemini")
- mime.AddExtensionType(".gemini", "text/gemini")
-}
-
// FileServer returns a handler that serves Gemini requests with the contents
// of the provided file system.
//
diff --git a/gemini.go b/gemini.go
index 6228526..bbe59ee 100644
--- a/gemini.go
+++ b/gemini.go
@@ -4,6 +4,12 @@ import (
"errors"
)
+func init() {
+ // Add Gemini mime types
+ mime.AddExtensionType(".gmi", "text/gemini")
+ mime.AddExtensionType(".gemini", "text/gemini")
+}
+
var crlf = []byte("\r\n")
// Errors.