fix(tus): reject negative upload-length to prevent inconsistent cache entry (#5876)

This commit is contained in:
Ariel Leyva
2026-04-04 03:11:50 -04:00
committed by GitHub
parent 0f39bd055e
commit 7a16129bfc

View File

@@ -105,7 +105,7 @@ func tusPostHandler(cache UploadCache) handleFunc {
}
uploadLength, err := getUploadLength(r)
if err != nil {
if err != nil || uploadLength < 0 {
return http.StatusBadRequest, fmt.Errorf("invalid upload length: %w", err)
}