From fc90a9e9dcd68861b7a02ada77ae1651e5a55c34 Mon Sep 17 00:00:00 2001 From: sta Date: Sun, 24 Nov 2019 21:12:35 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpListenerResponse.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index e6ac58d9..c4e7eaa0 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -896,13 +896,15 @@ namespace WebSocketSharp.Net if (templateResponse == null) throw new ArgumentNullException ("templateResponse"); - if (templateResponse._headers != null) { + var headers = templateResponse._headers; + + if (headers != null) { if (_headers != null) _headers.Clear (); - Headers.Add (templateResponse._headers); + Headers.Add (headers); } - else if (_headers != null) { + else { _headers = null; }