From d7e711a4fa63a90ee966d3e7c55245c530ff2fee Mon Sep 17 00:00:00 2001 From: Marin Ivanov Date: Wed, 21 Jan 2026 04:03:41 +0200 Subject: replace the "auto" mime-type with input placeholder --- main.go | 4 ++-- template.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 9af89eb..2b531a9 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,7 @@ func (s *Server) randomFile(ext string) (*os.File, string, error) { func (s *Server) createPosting(rd io.Reader, mimeType string) (string, error) { var ext string - if mimeType == "" || mimeType == "auto" { + if mimeType == "" { mimeType, ext, rd, _ = detectMimetype(rd) } else { mime := mimetype.Lookup(mimeType) @@ -215,7 +215,7 @@ func (s *Server) post(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusFound) } else { if mimeType == "application/x-www-form-urlencoded" { - mimeType = "auto" + mimeType = "" } name, err := s.createPosting(r.Body, mimeType) if err != nil { diff --git a/template.html b/template.html index 2d7f9e6..dba4b96 100644 --- a/template.html +++ b/template.html @@ -238,7 +238,7 @@
-- cgit v1.2.3