From b8146f623f70c8c1e74b86c8544948511d6f3fb5 Mon Sep 17 00:00:00 2001 From: kmicki Date: Tue, 21 Feb 2017 09:21:37 +0100 Subject: [PATCH] Ensure proper filename of generated torrent (#1085) Ensure that the filename of a torrent file sent to browser client doesn't contain invalid character and thus preventing HTTP Error 500. --- src/Jackett/Controllers/DownloadController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Jackett/Controllers/DownloadController.cs b/src/Jackett/Controllers/DownloadController.cs index e3cdc9686..05edde180 100644 --- a/src/Jackett/Controllers/DownloadController.cs +++ b/src/Jackett/Controllers/DownloadController.cs @@ -56,6 +56,12 @@ namespace Jackett.Controllers var torrentDictionary = BEncodedDictionary.DecodeTorrent(downloadBytes); downloadBytes = torrentDictionary.Encode(); + char[] invalidChars = System.IO.Path.GetInvalidFileNameChars(); + for(int i=0;i