[Modify] Continue if name is empty

This commit is contained in:
sta 2019-04-14 16:35:34 +09:00
parent 1d7de51c31
commit 816272a908

View File

@ -448,11 +448,14 @@ namespace WebSocketSharp.Net
if (idx == -1)
continue;
if (idx == pair.Length - 1)
if (idx == 0)
continue;
var name = pair.Substring (0, idx).TrimEnd (' ');
var val = pair.Substring (idx + 1).TrimStart (' ');
var val = idx < pair.Length - 1
? pair.Substring (idx + 1).TrimStart (' ')
: String.Empty;
cookie = new Cookie (name, val);
}