Skip to content

Commit

Permalink
Fix System.IndexOutOfRangeException
Browse files Browse the repository at this point in the history
Fix "System.IndexOutOfRangeException: Index was outside the bounds of the array." when row cookie is "Set-Cookie: ;Secure;SameSite=None"
  • Loading branch information
aidenpearce79 authored May 9, 2020
1 parent 4923986 commit 0ea2056
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Leaf.xNet/~Http/CookieStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 0ea2056

Please sign in to comment.