Skip to content

Commit 4da2b1d

Browse files
committed
.
1 parent 0036e1b commit 4da2b1d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/handles/fsup.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package handles
22

33
import (
4-
"github.com/alist-org/alist/v3/internal/task"
5-
"github.com/alist-org/alist/v3/pkg/utils"
64
"io"
75
"net/url"
86
stdpath "path"
97
"strconv"
108
"time"
119

10+
"github.com/alist-org/alist/v3/internal/task"
11+
"github.com/alist-org/alist/v3/pkg/utils"
12+
1213
"github.com/alist-org/alist/v3/internal/fs"
1314
"github.com/alist-org/alist/v3/internal/model"
1415
"github.com/alist-org/alist/v3/internal/stream"
@@ -44,7 +45,6 @@ func FsStream(c *gin.Context) {
4445
}
4546
if !overwrite {
4647
if res, _ := fs.Get(c, path, &fs.GetArgs{NoLog: true}); res != nil {
47-
_, _ = io.Copy(io.Discard, c.Request.Body)
4848
common.ErrorStrResp(c, "file exists", 403)
4949
return
5050
}
@@ -89,6 +89,9 @@ func FsStream(c *gin.Context) {
8989
return
9090
}
9191
if t == nil {
92+
if n, _ := c.Request.Body.Read(make([]byte, 1)); n == 1 {
93+
_, _ = io.Copy(io.Discard, c.Request.Body)
94+
}
9295
common.SuccessResp(c)
9396
return
9497
}

0 commit comments

Comments
 (0)