Use url_for("/download/{$diff_id}") instead