From 4c19a1ef633854ed803e5f662ac32384696248a1 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Sun, 4 Dec 2022 13:41:38 +1100 Subject: [PATCH] minor: return correct content type for jpg --- .../Areas/API/Controllers/DeviceBatchController.cs | 2 +- .../Areas/API/Controllers/DeviceController.cs | 2 +- Disco.Web/Areas/API/Controllers/JobController.cs | 2 +- Disco.Web/Areas/API/Controllers/UserController.cs | 14 ++++---------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs index f7965aee..f2c04b16 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceBatchController.cs @@ -644,7 +644,7 @@ namespace Disco.Web.Areas.API.Controllers if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) return File(thumbPath, "image/png"); else - return File(thumbPath, "image/jpg"); + return File(thumbPath, "image/jpeg"); } else return File(ClientSource.Style.Images.AttachmentTypes.MimeTypeIcons.Icon(attachment.MimeType), "image/png"); diff --git a/Disco.Web/Areas/API/Controllers/DeviceController.cs b/Disco.Web/Areas/API/Controllers/DeviceController.cs index 94e78a5e..dec3b499 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceController.cs @@ -460,7 +460,7 @@ namespace Disco.Web.Areas.API.Controllers if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) return File(thumbPath, "image/png"); else - return File(thumbPath, "image/jpg"); + return File(thumbPath, "image/jpeg"); } else return File(ClientSource.Style.Images.AttachmentTypes.MimeTypeIcons.Icon(da.MimeType), "image/png"); diff --git a/Disco.Web/Areas/API/Controllers/JobController.cs b/Disco.Web/Areas/API/Controllers/JobController.cs index 1cc0f854..679b3434 100644 --- a/Disco.Web/Areas/API/Controllers/JobController.cs +++ b/Disco.Web/Areas/API/Controllers/JobController.cs @@ -1904,7 +1904,7 @@ namespace Disco.Web.Areas.API.Controllers if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) return File(thumbPath, "image/png"); else - return File(thumbPath, "image/jpg"); + return File(thumbPath, "image/jpeg"); } else return File(ClientSource.Style.Images.AttachmentTypes.MimeTypeIcons.Icon(ja.MimeType), "image/png"); diff --git a/Disco.Web/Areas/API/Controllers/UserController.cs b/Disco.Web/Areas/API/Controllers/UserController.cs index 50f5be2c..46df4d8e 100644 --- a/Disco.Web/Areas/API/Controllers/UserController.cs +++ b/Disco.Web/Areas/API/Controllers/UserController.cs @@ -1,25 +1,19 @@ -using Disco.BI.Extensions; -using Disco.Models.Repository; -using Disco.Models.Services.Documents; -using Disco.Services; +using Disco.Services; using Disco.Services.Authorization; -using Disco.Services.Documents; using Disco.Services.Interop; using Disco.Services.Interop.ActiveDirectory; using Disco.Services.Plugins.Features.DetailsProvider; using Disco.Services.Users; using Disco.Services.Web; using System; -using System.IO; using System.Linq; -using System.Web; using System.Web.Mvc; namespace Disco.Web.Areas.API.Controllers { public partial class UserController : AuthorizedDatabaseController { - #region User Attachements + #region User Attachments [DiscoAuthorize(Claims.User.ShowAttachments)] [OutputCache(Location = System.Web.UI.OutputCacheLocation.Client, Duration = 172800)] @@ -54,7 +48,7 @@ namespace Disco.Web.Areas.API.Controllers if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) return File(thumbPath, "image/png"); else - return File(thumbPath, "image/jpg"); + return File(thumbPath, "image/jpeg"); } else return File(ClientSource.Style.Images.AttachmentTypes.MimeTypeIcons.Icon(ua.MimeType), "image/png"); @@ -209,7 +203,7 @@ namespace Disco.Web.Areas.API.Controllers if (photo == null) return HttpNotFound(); - return File(photo, "image/jpg"); + return File(photo, "image/jpeg"); } }