mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 13:22:56 +01:00
fix blossom upload < 50bytes
This commit is contained in:
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
|
// read first bytes of upload so we can find out the filetype
|
||||||
b := make([]byte, min(50, size), size)
|
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)
|
blossomError(w, "failed to read initial bytes of upload body: "+err.Error(), 400)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user