summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2026-01-21 04:03:41 +0200
committerMarin Ivanov <[email protected]>2026-01-21 04:03:41 +0200
commitd7e711a4fa63a90ee966d3e7c55245c530ff2fee (patch)
tree64fe6cbd67a510c5baa3a77c6172dd5cee87dc94
parentab19a573b9930b50f15b1f132f7f8cf4d8d1e040 (diff)
replace the "auto" mime-type with input placeholder
-rw-r--r--main.go4
-rw-r--r--template.html2
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 @@
<div>
<label>
Mime-Type:
- <input type="text" name="file_mimetype" value="auto" />
+ <input type="text" name="file_mimetype" placeholder="auto" value="" />
</label>
</div>
</div>