Fixed domain parsing regex on BrowserAction SetCookies.

This commit is contained in:
ruri
2019-05-31 18:50:32 +02:00
parent 10ac20b414
commit 4887d5a51b
+1 -1
View File
@@ -269,7 +269,7 @@ namespace RuriLib
break;
case BrowserAction.SetCookies:
var baseURL = Regex.Match(ReplaceValues(input, data), "^(?:https?:\\/\\/)?(?:[^@\\/\n]+@)?(?:www\\.)?([^:\\/?\n]+)").Groups[1].Value;
var baseURL = Regex.Match(ReplaceValues(input, data), "^(?:https?:\\/\\/)?(?:[^@\\/\n]+@)?([^:\\/?\n]+)").Groups[1].Value;
foreach (var cookie in data.Cookies)
{
try { data.Driver.Manage().Cookies.AddCookie(new Cookie(cookie.Key, cookie.Value, baseURL, "/", DateTime.MaxValue)); } catch { }