aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordatabase64128 <free122448@hotmail.com>2021-11-03 00:35:15 +0800
committerGitHub <noreply@github.com>2021-11-02 16:35:15 +0000
commit5b969d172b6dc900e89b77a630a8b1b72dff44a1 (patch)
tree8d8d2e6b76895e56217f1085fa42ac60ad31f1bf
parent1ec5b0709b65541c8acee1a34e7f419f8d2b60f1 (diff)
0️⃣ Media API: Fix maxFileSizeBytes=0 handling (#1993)
-rw-r--r--mediaapi/routing/download.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/mediaapi/routing/download.go b/mediaapi/routing/download.go
index 39b86b44..2358915e 100644
--- a/mediaapi/routing/download.go
+++ b/mediaapi/routing/download.go
@@ -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)
}