mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 01:26:43 +08:00
fix (chunked): chunked upload connection close
only close connection when using chunked upload. This is key if you must use something like to work with Cloudflare
This commit is contained in:
@ -438,7 +438,6 @@ func FileSave(ctx *App, res http.ResponseWriter, req *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res.Header().Set("Connection", "Close")
|
|
||||||
|
|
||||||
// There is 2 ways to save something:
|
// There is 2 ways to save something:
|
||||||
// - case1: regular upload, we just insert the file in the pipe
|
// - case1: regular upload, we just insert the file in the pipe
|
||||||
@ -461,6 +460,7 @@ func FileSave(ctx *App, res http.ResponseWriter, req *http.Request) {
|
|||||||
SendErrorResult(res, NewError(err.Error(), 403))
|
SendErrorResult(res, NewError(err.Error(), 403))
|
||||||
}
|
}
|
||||||
ctx.Session["path"] = path
|
ctx.Session["path"] = path
|
||||||
|
res.Header().Set("Connection", "Close")
|
||||||
|
|
||||||
var uploader *chunkedUpload
|
var uploader *chunkedUpload
|
||||||
if c := chunkedUploadCache.Get(ctx.Session); c == nil {
|
if c := chunkedUploadCache.Get(ctx.Session); c == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user