Fixed: UI not updating on upgrade

(cherry picked from commit d566c1efd42f9a94c524db311e8fa99bc6e0323f)
This commit is contained in:
ta264
2021-04-20 21:57:24 +01:00
parent 8f3f90d407
commit 4b0586bd3d
8 changed files with 47 additions and 25 deletions

View File

@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Configuration;
using Readarr.Http.Extensions;
using Readarr.Http.Frontend.Mappers;
namespace Readarr.Http.Frontend
@@ -36,6 +37,7 @@ namespace Readarr.Http.Frontend
[HttpGet("login")]
public IActionResult LoginPage()
{
Response.Headers.DisableCache();
return PhysicalFile(_loginPath, "text/html");
}
@@ -62,7 +64,19 @@ namespace Readarr.Http.Frontend
if (mapper != null)
{
return mapper.GetResponse(path) ?? NotFound();
var result = mapper.GetResponse(path);
if (result != null)
{
if (result.ContentType == "text/html")
{
Response.Headers.DisableCache();
}
return result;
}
return NotFound();
}
_logger.Warn("Couldn't find handler for {0}", path);