From 33b1b579d64550e56be69d46c6fc8817fcc44e76 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Tue, 10 Nov 2026 11:47:06 -0500 Subject: [PATCH] add comment to replace mime type detector --- handlers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handlers.go b/handlers.go index 3dc4757..df41ac2 100644 --- a/handlers.go +++ b/handlers.go @@ -211,5 +211,9 @@ func detectMimeType(file io.ReadSeeker) (string, error) { if readErr != nil && readErr != io.EOF && readErr != io.ErrUnexpectedEOF { return "", fmt.Errorf("read file header: %w", readErr) } + + // will replace later, http.DetectContentType doesnt detect as much as i want it to + // github.com/google/magika - ML based, working on bindings for go? requires cgo & onnxruntime + // github.com/gabriel-vasile/mimetype - native go, similar amount of labels to magika return http.DetectContentType(buffer[:n]), nil }