From 0ea205668515f1193e2373ea57b384e0eded2517 Mon Sep 17 00:00:00 2001 From: aidenpearce79 <57640278+aidenpearce79@users.noreply.github.com> Date: Sat, 9 May 2020 08:05:02 +0500 Subject: [PATCH] Fix System.IndexOutOfRangeException Fix "System.IndexOutOfRangeException: Index was outside the bounds of the array." when row cookie is "Set-Cookie: ;Secure;SameSite=None" --- Leaf.xNet/~Http/CookieStorage.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Leaf.xNet/~Http/CookieStorage.cs b/Leaf.xNet/~Http/CookieStorage.cs index d0fdc11..2b1febe 100644 --- a/Leaf.xNet/~Http/CookieStorage.cs +++ b/Leaf.xNet/~Http/CookieStorage.cs @@ -156,6 +156,9 @@ public void Set(Uri requestAddress, string rawCookie) // Получаем ключ и значение самой Cookie var keyValue = arguments[0].Split(new[] {'='}, 2); + if (keyValue.Length <= 1) + return; + keyValue[0] = keyValue[0].Trim(); keyValue[1] = keyValue[1].Trim();