From 636119a119955ed4e5f8a1224c90a035b466cf9e Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 7 Mar 2020 21:54:51 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/WebHeaderCollection.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index a2d88c7e..a81c9258 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -835,8 +835,12 @@ namespace WebSocketSharp.Net return String.Empty; value = value.Trim (); - if (value.Length > 65535) - throw new ArgumentOutOfRangeException ("value", "Greater than 65,535 characters."); + + if (value.Length > 65535) { + var msg = "The length is greater than 65,535 characters."; + + throw new ArgumentOutOfRangeException ("value", msg); + } if (!IsHeaderValue (value)) throw new ArgumentException ("Contains invalid characters.", "value");