From 5b969d172b6dc900e89b77a630a8b1b72dff44a1 Mon Sep 17 00:00:00 2001 From: database64128 Date: Wed, 3 Nov 2021 00:35:15 +0800 Subject: [PATCH] =?UTF-8?q?0=EF=B8=8F=E2=83=A3=20Media=20API:=20Fix=20maxF?= =?UTF-8?q?ileSizeBytes=3D0=20handling=20(#1993)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mediaapi/routing/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }