Fixed cookie domain cannot be an empty string bug in CF Bypass Block.

This commit is contained in:
ruri
2019-06-19 14:01:14 +02:00
parent cfcbd76ff3
commit a4fb0f3334
+2 -3
View File
@@ -84,6 +84,7 @@ namespace RuriLib
}
var localUrl = ReplaceValues(url, data);
var uri = new Uri(localUrl);
var timeout = data.GlobalSettings.General.RequestTimeout * 1000;
@@ -109,7 +110,7 @@ namespace RuriLib
CookieContainer cookies = new CookieContainer();
foreach (var cookie in data.Cookies)
cookies.Add(new Cookie(cookie.Key, cookie.Value));
cookies.Add(new Cookie(cookie.Key, cookie.Value, "/", uri.Host));
if (data.UseProxies)
{
@@ -148,8 +149,6 @@ namespace RuriLib
httpClient.Timeout = TimeSpan.FromMinutes(timeout);
httpClient.DefaultRequestHeaders.Add("User-Agent", ReplaceValues(userAgent, data));
var uri = new Uri(localUrl);
// Solve the CF challenge
var result = cf.Solve(httpClient, handler, uri).Result;
if (result.Success)