diff --git a/common/ASC.Data.Backup.Core/BackupFileUploadHandler.cs b/common/ASC.Data.Backup.Core/BackupFileUploadHandler.cs index ff695e4c2b..563f7c2916 100644 --- a/common/ASC.Data.Backup.Core/BackupFileUploadHandler.cs +++ b/common/ASC.Data.Backup.Core/BackupFileUploadHandler.cs @@ -22,8 +22,8 @@ // // All the Product's GUI elements, including illustrations and icon sets, as well as technical writing // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 -// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - +// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + namespace ASC.Web.Studio.Core.Backup; public class BackupFileUploadHandler @@ -112,7 +112,10 @@ public class BackupFileUploadHandler result = Error(error.Message); } - await context.Response.WriteAsync(System.Text.Json.JsonSerializer.Serialize(result)); + await context.Response.WriteAsync(System.Text.Json.JsonSerializer.Serialize(result, new System.Text.Json.JsonSerializerOptions() + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault + })); } private BackupFileUploadResult Success(int chunk = 0, bool endUpload = false) diff --git a/common/services/ASC.Data.Backup/GlobalUsings.cs b/common/services/ASC.Data.Backup/GlobalUsings.cs index 90030ba42a..02f9e6bc9c 100644 --- a/common/services/ASC.Data.Backup/GlobalUsings.cs +++ b/common/services/ASC.Data.Backup/GlobalUsings.cs @@ -36,6 +36,7 @@ global using ASC.Data.Backup.Contracts; global using ASC.Data.Backup.Core.IntegrationEvents.Events; global using ASC.Data.Backup.EF.Context; global using ASC.Data.Backup.Extension; +global using System.Text.Json.Serialization; global using ASC.Data.Backup.Services; global using ASC.EventBus.Abstractions; global using ASC.Files.Core.EF;