Skip to content

Commit 0ea2056

Browse files
Fix System.IndexOutOfRangeException
Fix "System.IndexOutOfRangeException: Index was outside the bounds of the array." when row cookie is "Set-Cookie: ;Secure;SameSite=None"
1 parent 4923986 commit 0ea2056

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Leaf.xNet/~Http/CookieStorage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public void Set(Uri requestAddress, string rawCookie)
156156

157157
// Получаем ключ и значение самой Cookie
158158
var keyValue = arguments[0].Split(new[] {'='}, 2);
159+
if (keyValue.Length <= 1)
160+
return;
161+
159162
keyValue[0] = keyValue[0].Trim();
160163
keyValue[1] = keyValue[1].Trim();
161164

0 commit comments

Comments
 (0)