Attachment downloads are broken for files over 500 MiB

(#600) Bug Needs triage media self-hosting

Thread

Comment by @cirogargatagli
RexSystem 1 vote edited originally by @cirogargatagli on GitHub
Same error for me. After investigating, I found that serve_stored_passthrough_stream() rejects any object whose size exceeds constants::MAX_MEDIA_PROXY_BYTES before attempting to stream it:
if head.content_length > constants::MAX_MEDIA_PROXY_BYTES as u64 {
    return storage_error_response(key, StorageError::StreamTooLong);
}
MAX_MEDIA_PROXY_BYTES is currently defined as:
pub const MAX_MEDIA_PROXY_BYTES: usize = 500 * 1024 * 1024;