mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 07:23:10 -06:00
mediaapi/writers/download: Only try to write as much as was read
This commit is contained in:
parent
8f68f61117
commit
df52b1aef2
|
|
@ -279,7 +279,7 @@ func Download(w http.ResponseWriter, req *http.Request, origin types.ServerName,
|
|||
fetchError = errFileIsTooLarge
|
||||
} else {
|
||||
// write to disk
|
||||
bytesTemp, writeErr := writer.Write(buffer)
|
||||
bytesTemp, writeErr := writer.Write(buffer[:bytesRead])
|
||||
if writeErr != nil && writeErr != io.EOF {
|
||||
fetchError = errWrite
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue