fix: dont try to stream if we have an error

This commit is contained in:
Derrick Hammer 2023-05-08 10:16:47 -04:00
parent 9b17557d14
commit b21a425e24
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -155,7 +155,9 @@ func (f *FilesService) GetDownload() {
ctx.Header("Transfer-Encoding", "chunked") ctx.Header("Transfer-Encoding", "chunked")
internalError(ctx, err) if internalError(ctx, err) {
return
}
err = ctx.StreamWriter(func(w io.Writer) error { err = ctx.StreamWriter(func(w io.Writer) error {
_, err = io.Copy(w, fetch.RawBody()) _, err = io.Copy(w, fetch.RawBody())