From 6cc2477e8986fedcde0a0cae86cee86269d51fcc Mon Sep 17 00:00:00 2001 From: andrewheadricke Date: Fri, 14 Mar 2025 15:14:13 +1100 Subject: [PATCH] fix blossom upload < 50bytes --- blossom/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blossom/handlers.go b/blossom/handlers.go index d9fca4e..f713aa8 100644 --- a/blossom/handlers.go +++ b/blossom/handlers.go @@ -73,7 +73,7 @@ func (bs BlossomServer) handleUpload(w http.ResponseWriter, r *http.Request) { // read first bytes of upload so we can find out the filetype b := make([]byte, min(50, size), size) - if _, err = r.Body.Read(b); err != nil { + if n, err := r.Body.Read(b); err != nil && n != size { blossomError(w, "failed to read initial bytes of upload body: "+err.Error(), 400) return }