Ignore invalid cookies when adding response cookies to CookieContainer

Fixes #1868
pull/1786/head
Bogdan 1 year ago
parent 1a9ec4febd
commit 3283d144f5

@ -221,11 +221,18 @@ namespace NzbDrone.Common.Http
}; };
} }
sourceContainer.Add((Uri)request.Url, cookie); try
{
sourceContainer.Add((Uri)request.Url, cookie);
if (request.StoreRequestCookie) if (request.StoreRequestCookie)
{
presistentContainer.Add((Uri)request.Url, cookie);
}
}
catch (CookieException ex)
{ {
presistentContainer.Add((Uri)request.Url, cookie); _logger.Debug(ex, "Invalid cookie in {0}", (Uri)request.Url);
} }
} }
} }
@ -260,7 +267,14 @@ namespace NzbDrone.Common.Http
}; };
} }
sourceContainer.Add((Uri)request.Url, cookie); try
{
sourceContainer.Add((Uri)request.Url, cookie);
}
catch (CookieException ex)
{
_logger.Debug(ex, "Invalid cookie in {0}", (Uri)request.Url);
}
} }
} }

Loading…
Cancel
Save