Correctly use sf-boolean syntax for Upload-Incomplete

This commit is contained in:
Marius 2021-11-20 16:57:20 +01:00
parent 947141b180
commit 80ff08a50c
1 changed files with 3 additions and 3 deletions

View File

@ -438,7 +438,7 @@ func (handler *UnroutedHandler) PostFileV2(w http.ResponseWriter, r *http.Reques
handler.sendError(w, r, ErrInvalidOffset) handler.sendError(w, r, ErrInvalidOffset)
return return
} }
isIncomplete := r.Header.Get("Upload-Incomplete") == "1" isIncomplete := r.Header.Get("Upload-Incomplete") == "?1"
// 1. Get or create upload resource // 1. Get or create upload resource
// TODO: Create consistent ID from token? e.g. using SHA256 // TODO: Create consistent ID from token? e.g. using SHA256
@ -594,9 +594,9 @@ func (handler *UnroutedHandler) HeadFile(w http.ResponseWriter, r *http.Request)
} }
} else { } else {
if info.SizeIsDeferred { if info.SizeIsDeferred {
w.Header().Set("Upload-Incomplete", "1") w.Header().Set("Upload-Incomplete", "?1")
} else { } else {
w.Header().Set("Upload-Incomplete", "0") w.Header().Set("Upload-Incomplete", "?0")
} }
} }