From d71c7e2e9ab9f837fffabf61d5f524daf033f72e Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 2 Mar 2020 17:37:01 +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 f33745c6..a7b305b9 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -793,8 +793,12 @@ namespace WebSocketSharp.Net throw new ArgumentNullException ("name"); name = name.Trim (); - if (!IsHeaderName (name)) - throw new ArgumentException ("Contains invalid characters.", "name"); + + if (!IsHeaderName (name)) { + var msg = "It contains an invalid character."; + + throw new ArgumentException (msg, "name"); + } return name; }