mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added: Radarr now stores cookies for PTP beyond restarts. Should limit active sessions correctly. (#2643)
Fixes #2626
This commit is contained in:
@@ -55,20 +55,22 @@ namespace NzbDrone.Common.Http
|
||||
StatusCode == HttpStatusCode.MovedPermanently ||
|
||||
StatusCode == HttpStatusCode.Found;
|
||||
|
||||
public string[] GetCookieHeaders()
|
||||
{
|
||||
return Headers.GetValues("Set-Cookie") ?? new string[0];
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetCookies()
|
||||
{
|
||||
var result = new Dictionary<string, string>();
|
||||
|
||||
var setCookieHeaders = Headers.GetValues("Set-Cookie");
|
||||
if (setCookieHeaders != null)
|
||||
var setCookieHeaders = GetCookieHeaders();
|
||||
foreach (var cookie in setCookieHeaders)
|
||||
{
|
||||
foreach (var cookie in setCookieHeaders)
|
||||
var match = RegexSetCookie.Match(cookie);
|
||||
if (match.Success)
|
||||
{
|
||||
var match = RegexSetCookie.Match(cookie);
|
||||
if (match.Success)
|
||||
{
|
||||
result[match.Groups[1].Value] = match.Groups[2].Value;
|
||||
}
|
||||
result[match.Groups[1].Value] = match.Groups[2].Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user