New: ical is available with API key authentication

This commit is contained in:
Mark McDowall 2014-04-21 21:55:42 -07:00
parent bb25c8955c
commit 78ded70b39
2 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,7 @@ namespace NzbDrone.Api.Authentication
var apiKey = GetApiKey(context);
if (context.Request.IsApiRequest() && !ValidApiKey(apiKey))
if ((context.Request.IsApiRequest() || context.Request.IsFeedRequest()) && !ValidApiKey(apiKey))
{
response = new Response { StatusCode = HttpStatusCode.Unauthorized };
}

View File

@ -10,6 +10,11 @@ namespace NzbDrone.Api.Extensions
return request.Path.StartsWith("/api/", StringComparison.InvariantCultureIgnoreCase);
}
public static bool IsFeedRequest(this Request request)
{
return request.Path.StartsWith("/feed/", StringComparison.InvariantCultureIgnoreCase);
}
public static bool IsSignalRRequest(this Request request)
{
return request.Path.StartsWith("/signalr/", StringComparison.InvariantCultureIgnoreCase);