mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: capacity should be returned back when put failed
This commit is contained in:
@@ -131,7 +131,7 @@ const (
|
||||
)
|
||||
|
||||
func lex(s string) (tokenType rune, tokenStr string, remaining string) {
|
||||
// The net/textproto Reader that parses the HTTP header will collapse
|
||||
// The net/textproto Data that parses the HTTP header will collapse
|
||||
// Linear White Space that spans multiple "\r\n" lines to a single " ",
|
||||
// so we don't need to look for '\r' or '\n'.
|
||||
for len(s) > 0 && (s[0] == '\t' || s[0] == ' ') {
|
||||
|
||||
@@ -346,6 +346,7 @@ func (h *Handler) handlePut(w http.ResponseWriter, r *http.Request, fs *filesyst
|
||||
fs.Use("AfterUpload", filesystem.GenericAfterUpload)
|
||||
fs.Use("AfterValidateFailed", filesystem.HookDeleteTempFile)
|
||||
fs.Use("AfterValidateFailed", filesystem.HookGiveBackCapacity)
|
||||
fs.Use("AfterUploadFailed", filesystem.HookGiveBackCapacity)
|
||||
}
|
||||
|
||||
// 执行上传
|
||||
|
||||
Reference in New Issue
Block a user