1
0
Fork 0
mirror of https://github.com/matrix-org/dendrite.git synced 2025-03-30 21:44:28 -05:00

0️⃣ Media API: Fix maxFileSizeBytes=0 handling ()

This commit is contained in:
database64128 2021-11-03 00:35:15 +08:00 committed by GitHub
parent 1ec5b0709b
commit 5b969d172b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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