mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
fix cookie handling
This commit is contained in:
@@ -40,11 +40,12 @@ namespace Jackett.Utils.Clients
|
||||
if (!string.IsNullOrEmpty(webRequest.Cookies))
|
||||
{
|
||||
var uri = new Uri(webRequest.Url);
|
||||
var cookieUrl = new Uri("//" + uri.Host); // don't include the path
|
||||
foreach (var c in webRequest.Cookies.Split(';'))
|
||||
{
|
||||
try
|
||||
{
|
||||
cookies.SetCookies(uri, c);
|
||||
cookies.SetCookies(cookieUrl, c.Trim());
|
||||
}
|
||||
catch (CookieException ex)
|
||||
{
|
||||
|
@@ -86,6 +86,7 @@ namespace Jackett.Utils.Clients
|
||||
if (!string.IsNullOrEmpty(webRequest.Cookies))
|
||||
{
|
||||
// add cookies to cookiecontainer
|
||||
var cookieUrl = new Uri("//" + request.RequestUri.Host); // don't include the path
|
||||
foreach (var ccookiestr in webRequest.Cookies.Split(';'))
|
||||
{
|
||||
var cookiestrparts = ccookiestr.Split('=');
|
||||
@@ -96,7 +97,7 @@ namespace Jackett.Utils.Clients
|
||||
if (cookiestrparts.Length >= 2)
|
||||
value = cookiestrparts[1].Trim();
|
||||
var cookie = new Cookie(name, value);
|
||||
cookies.Add(request.RequestUri, cookie);
|
||||
cookies.Add(cookieUrl, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user