New: ical is available with API key authentication
This commit is contained in:
parent
bb25c8955c
commit
78ded70b39
|
@ -29,7 +29,7 @@ namespace NzbDrone.Api.Authentication
|
||||||
|
|
||||||
var apiKey = GetApiKey(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 };
|
response = new Response { StatusCode = HttpStatusCode.Unauthorized };
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,11 @@ namespace NzbDrone.Api.Extensions
|
||||||
return request.Path.StartsWith("/api/", StringComparison.InvariantCultureIgnoreCase);
|
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)
|
public static bool IsSignalRRequest(this Request request)
|
||||||
{
|
{
|
||||||
return request.Path.StartsWith("/signalr/", StringComparison.InvariantCultureIgnoreCase);
|
return request.Path.StartsWith("/signalr/", StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
Loading…
Reference in New Issue