diff options
author | database64128 <free122448@hotmail.com> | 2021-06-22 17:01:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 10:01:44 +0100 |
commit | 79181f23486f36abed4a84b29757abaea3f6e28b (patch) | |
tree | 3971905576f24c5df0e4d48a47cda6f9b13dee4c /mediaapi | |
parent | 5357df36c9adc6de24653f181a5d3a5070a23ce2 (diff) |
✂️ Media API: Handle unlimited file size (#1881)
Diffstat (limited to 'mediaapi')
-rw-r--r-- | mediaapi/routing/download.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mediaapi/routing/download.go b/mediaapi/routing/download.go index 017fcfa3..39b86b44 100644 --- a/mediaapi/routing/download.go +++ b/mediaapi/routing/download.go @@ -685,7 +685,7 @@ func (r *downloadRequest) GetContentLengthAndReader(contentLengthHeader string, r.Logger.WithError(parseErr).Warn("Failed to parse content length") return 0, nil, fmt.Errorf("strconv.ParseInt: %w", parseErr) } - if parsedLength > int64(maxFileSizeBytes) { + if maxFileSizeBytes > 0 && parsedLength > int64(maxFileSizeBytes) { return 0, nil, fmt.Errorf( "remote file size (%d bytes) exceeds locally configured max media size (%d bytes)", parsedLength, maxFileSizeBytes, |