Changed download urls

I changed the download urls, because the current way with segments
(having the parameters between slashes) was causing problems with long
encoded urls, since a segment can be no longer than 255 characters. It
was changed to use regular url parameters which have no such limit on
length.
This commit is contained in:
René Simonsen
2015-10-26 10:20:14 +01:00
parent e56875f1a3
commit 4392219158
8 changed files with 42 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ namespace Jackett.Controllers
}
[HttpGet]
public async Task<HttpResponseMessage> Download(string indexerID, string path, string apikey)
public async Task<HttpResponseMessage> Download(string indexerID, string path, string apikey, string file)
{
try
{
@@ -54,6 +54,10 @@ namespace Jackett.Controllers
var result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new ByteArrayContent(downloadBytes);
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-bittorrent");
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = file
};
return result;
}
catch (Exception e)