From 203989148fe267d549cc8348771d729967e58d3a Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 30 Nov 2019 22:39:43 +0900 Subject: [PATCH] [Modify] Replace it --- websocket-sharp/Net/HttpListenerResponse.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index c17d1289..893c8fca 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -660,16 +660,16 @@ namespace WebSocketSharp.Net internal WebHeaderCollection WriteHeadersTo (MemoryStream destination) { var headers = new WebHeaderCollection (HttpHeaderType.Response, true); + if (_headers != null) headers.Add (_headers); if (_contentType != null) { - var type = _contentType.IndexOf ("charset=", StringComparison.Ordinal) == -1 && - _contentEncoding != null - ? String.Format ("{0}; charset={1}", _contentType, _contentEncoding.WebName) - : _contentType; - - headers.InternalSet ("Content-Type", type, true); + headers.InternalSet ( + "Content-Type", + createContentTypeHeaderText (_contentType, _contentEncoding), + true + ); } if (headers["Server"] == null)