|
|
@ -1,5 +1,4 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Cors;
|
|
|
|
using Microsoft.AspNetCore.Cors;
|
|
|
@ -16,29 +15,21 @@ namespace Prowlarr.Http.Frontend
|
|
|
|
[ApiController]
|
|
|
|
[ApiController]
|
|
|
|
public class StaticResourceController : Controller
|
|
|
|
public class StaticResourceController : Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly string _urlBase;
|
|
|
|
|
|
|
|
private readonly string _loginPath;
|
|
|
|
|
|
|
|
private readonly IEnumerable<IMapHttpRequestsToDisk> _requestMappers;
|
|
|
|
private readonly IEnumerable<IMapHttpRequestsToDisk> _requestMappers;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public StaticResourceController(IConfigFileProvider configFileProvider,
|
|
|
|
public StaticResourceController(IEnumerable<IMapHttpRequestsToDisk> requestMappers,
|
|
|
|
IAppFolderInfo appFolderInfo,
|
|
|
|
|
|
|
|
IEnumerable<IMapHttpRequestsToDisk> requestMappers,
|
|
|
|
|
|
|
|
Logger logger)
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_urlBase = configFileProvider.UrlBase.Trim('/');
|
|
|
|
|
|
|
|
_requestMappers = requestMappers;
|
|
|
|
_requestMappers = requestMappers;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
|
|
_loginPath = Path.Combine(appFolderInfo.StartUpFolder, configFileProvider.UiFolder, "login.html");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
[AllowAnonymous]
|
|
|
|
[HttpGet("login")]
|
|
|
|
[HttpGet("login")]
|
|
|
|
public IActionResult LoginPage()
|
|
|
|
public IActionResult LoginPage()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Response.Headers.DisableCache();
|
|
|
|
return MapResource("login");
|
|
|
|
return PhysicalFile(_loginPath, "text/html");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[EnableCors("AllowGet")]
|
|
|
|
[EnableCors("AllowGet")]
|
|
|
|