feat: optimize mime type

This commit is contained in:
2026-02-15 18:49:22 +01:00
parent f85afce949
commit df0bf9bed7
6 changed files with 103 additions and 2 deletions

View File

@@ -7,7 +7,6 @@ import (
"io"
"io/fs"
"log/slog"
"mime"
"net"
"os"
"path"
@@ -74,7 +73,7 @@ func sendFile(file *os.File, conn net.Conn) {
parts := strings.Split(fileStat.Name(), ".")
ext := "." + parts[len(parts)-1]
mime_type := mime.TypeByExtension(ext)
mime_type := rh.ExtensionToMimetype[ext]
length := fileStat.Size()
if mime_type == "" {