From 6a6a652528d6784e61dbcf4b54f0533c65026cab Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 7 May 2020 20:59:42 +0900 Subject: [PATCH] [Fix] Fix for no value --- websocket-sharp/Net/WebHeaderCollection.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 76269de0..4bf37324 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -991,7 +991,9 @@ namespace WebSocketSharp.Net } var name = header.Substring (0, idx); - var val = header.Substring (idx + 1); + var val = idx < header.Length - 1 + ? header.Substring (idx + 1) + : String.Empty; InternalSet (name, val, response); }