mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-07-07 15:19:53 +02:00
fix blossom upload < 50bytes
This commit is contained in:
committed by
fiatjaf_
parent
581c4ece28
commit
6cc2477e89
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user