0️⃣ Media API: Fix maxFileSizeBytes=0 handling

This commit is contained in:
database64128 2021-08-30 15:51:05 +08:00
parent 51b119107c
commit 221ed52e38
No known key found for this signature in database
GPG key ID: 1CA27546BEDB8B01

View file

@ -737,7 +737,7 @@ func (r *downloadRequest) fetchRemoteFile(
return "", false, parseErr
}
if contentLength > int64(maxFileSizeBytes) {
if maxFileSizeBytes > 0 && contentLength > int64(maxFileSizeBytes) {
// TODO: Bubble up this as a 413
return "", false, fmt.Errorf("remote file is too large (%v > %v bytes)", contentLength, maxFileSizeBytes)
}