|
|
|
@ -183,11 +183,15 @@ func serveHTTPS(w http.ResponseWriter, r *http.Request) (int, int64, string) {
|
|
|
|
|
fileExt := strings.ToLower(filepath.Ext(filePath))
|
|
|
|
|
if fileExt == ".gmi" || fileExt == ".gemini" {
|
|
|
|
|
result = gmitohtml.Convert([]byte(data), r.URL.String())
|
|
|
|
|
} else if fileExt == ".htm" || fileExt == ".html" {
|
|
|
|
|
result = data
|
|
|
|
|
} else {
|
|
|
|
|
result = data
|
|
|
|
|
contentType = plainType
|
|
|
|
|
if fileExt == ".htm" || fileExt == ".html" {
|
|
|
|
|
// HTML content type already set
|
|
|
|
|
} else if customType := config.Types[filepath.Ext(filePath)]; customType != "" {
|
|
|
|
|
contentType = customType
|
|
|
|
|
} else {
|
|
|
|
|
contentType = plainType
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
status := http.StatusOK
|
|
|
|
|