Couple of bugfixes

This commit is contained in:
Kayomani
2015-07-22 23:48:02 +01:00
parent d016c6f8ad
commit 9a15f8a965
2 changed files with 6 additions and 6 deletions

View File

@@ -34,11 +34,6 @@ namespace Jackett.Controllers
var indexer = indexerService.GetIndexer(indexerName);
var torznabQuery = TorznabQuery.FromHttpQuery(HttpUtility.ParseQueryString(Request.RequestUri.Query));
if (!string.Equals(torznabQuery.ApiKey, serverService.Config.APIKey, StringComparison.InvariantCultureIgnoreCase))
{
return Request.CreateResponse(HttpStatusCode.Forbidden, "Incorrect API key");
}
if (string.Equals(torznabQuery.QueryType, "caps", StringComparison.InvariantCultureIgnoreCase))
{
return new HttpResponseMessage()
@@ -47,6 +42,11 @@ namespace Jackett.Controllers
};
}
if (!string.Equals(torznabQuery.ApiKey, serverService.Config.APIKey, StringComparison.InvariantCultureIgnoreCase))
{
return Request.CreateResponse(HttpStatusCode.Forbidden, "Incorrect API key");
}
var releases = await indexer.PerformQuery(torznabQuery);
logger.Info(string.Format("Found {0} releases from {1}", releases.Length, indexer.DisplayName));