mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 19:32:27 +08:00
fix (tus): edge case with cancellation
This commit is contained in:
@ -488,7 +488,14 @@ func FileSave(ctx *App, res http.ResponseWriter, req *http.Request) {
|
|||||||
SendErrorResult(res, ErrNotValid)
|
SendErrorResult(res, ErrNotValid)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uploader := createChunkedUploader(ctx.Backend.Save, path, size)
|
ctx.Context = context.Background()
|
||||||
|
b, err := ctx.Backend.Init(ctx.Session, ctx)
|
||||||
|
if err != nil {
|
||||||
|
Log.Debug("files::save::tus action=backend_save step=backend_init err=%s", err.Error())
|
||||||
|
SendErrorResult(res, ErrNotValid)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uploader := createChunkedUploader(b.Save, path, size)
|
||||||
chunkedUploadCache.Set(cacheKey, uploader)
|
chunkedUploadCache.Set(cacheKey, uploader)
|
||||||
h.Set("Content-Length", "0")
|
h.Set("Content-Length", "0")
|
||||||
h.Set("Location", req.URL.String())
|
h.Set("Location", req.URL.String())
|
||||||
|
|||||||
Reference in New Issue
Block a user