feat: optimize mime type
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user