From 7cfdaf4b418b0d646750bf3f2d7b2fd0e647eea4 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Thu, 10 Nov 2016 08:37:52 +0100 Subject: [PATCH] Make cookie merging more robust (#669) --- src/Jackett/Indexers/BaseIndexer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Jackett/Indexers/BaseIndexer.cs b/src/Jackett/Indexers/BaseIndexer.cs index 632d513f6..51a57bf61 100644 --- a/src/Jackett/Indexers/BaseIndexer.cs +++ b/src/Jackett/Indexers/BaseIndexer.cs @@ -186,7 +186,7 @@ namespace Jackett.Indexers private String ResolveCookies(String incomingCookies = "") { var redirRequestCookies = (CookieHeader != null && CookieHeader != "" ? CookieHeader + " " : "") + incomingCookies; - System.Text.RegularExpressions.Regex expression = new System.Text.RegularExpressions.Regex(@"([^\s]+)=([^=]+)(?:\s|$)"); + System.Text.RegularExpressions.Regex expression = new System.Text.RegularExpressions.Regex(@"([^\\,;\s]+)=([^=\\,;\s]+)"); Dictionary cookieDIctionary = new Dictionary(); var matches = expression.Match(redirRequestCookies); while (matches.Success) @@ -194,7 +194,7 @@ namespace Jackett.Indexers if (matches.Groups.Count > 2) cookieDIctionary[matches.Groups[1].Value] = matches.Groups[2].Value; matches = matches.NextMatch(); } - return string.Join(" ", cookieDIctionary.Select(kv => kv.Key.ToString() + "=" + kv.Value.ToString()).ToArray()); + return string.Join("; ", cookieDIctionary.Select(kv => kv.Key.ToString() + "=" + kv.Value.ToString()).ToArray()); }