Fixed: UI not updating on upgrade

This commit is contained in:
ta264
2021-04-20 21:15:49 +01:00
parent 490f6e2e6a
commit d566c1efd4
8 changed files with 47 additions and 25 deletions

View File

@@ -6,6 +6,6 @@ namespace Prowlarr.Http.Frontend.Mappers
{
string Map(string resourceUrl);
bool CanHandle(string resourceUrl);
IActionResult GetResponse(string resourceUrl);
FileStreamResult GetResponse(string resourceUrl);
}
}

View File

@@ -28,7 +28,7 @@ namespace Prowlarr.Http.Frontend.Mappers
public abstract bool CanHandle(string resourceUrl);
public virtual IActionResult GetResponse(string resourceUrl)
public FileStreamResult GetResponse(string resourceUrl)
{
var filePath = Map(resourceUrl);

View File

@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Configuration;
using Prowlarr.Http.Extensions;
using Prowlarr.Http.Frontend.Mappers;
namespace Prowlarr.Http.Frontend
@@ -36,6 +37,7 @@ namespace Prowlarr.Http.Frontend
[HttpGet("login")]
public IActionResult LoginPage()
{
Response.Headers.DisableCache();
return PhysicalFile(_loginPath, "text/html");
}
@@ -62,7 +64,19 @@ namespace Prowlarr.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);