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:
parent
bb25c8955c
commit
78ded70b39
@ -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 };
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user