Fixed: Don't redirect //api route to homepage

pull/1143/head
ta264 4 years ago
parent eaa1578c65
commit e791f22333

@ -4,8 +4,6 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NLog; using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Configuration;
using Readarr.Http.Extensions; using Readarr.Http.Extensions;
using Readarr.Http.Frontend.Mappers; using Readarr.Http.Frontend.Mappers;
@ -34,14 +32,14 @@ namespace Readarr.Http.Frontend
[EnableCors("AllowGet")] [EnableCors("AllowGet")]
[AllowAnonymous] [AllowAnonymous]
[HttpGet("/content/{**path:regex(^(?!api/).*)}")] [HttpGet("content/{**path:regex(^(?!/*api/).*)}")]
public IActionResult IndexContent([FromRoute] string path) public IActionResult IndexContent([FromRoute] string path)
{ {
return MapResource("Content/" + path); return MapResource("Content/" + path);
} }
[HttpGet("")] [HttpGet("")]
[HttpGet("/{**path:regex(^(?!api/).*)}")] [HttpGet("/{**path:regex(^(?!/*api/).*)}")]
public IActionResult Index([FromRoute] string path) public IActionResult Index([FromRoute] string path)
{ {
return MapResource(path); return MapResource(path);

Loading…
Cancel
Save