1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

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 @@ public Response ValidateApiKey(NancyContext context)
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 @@ public static bool IsApiRequest(this Request request)
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);