From 9ad62f6a5f9f1963550b6cf7d6eab73560693ec3 Mon Sep 17 00:00:00 2001 From: sta Date: Sun, 21 Jun 2015 16:46:58 +0900 Subject: [PATCH] Refactored a few for HttpListenerResponse.cs --- websocket-sharp/Net/HttpListenerResponse.cs | 25 ++++++--------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index 89f2d5f1..d4629143 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -121,9 +121,6 @@ namespace WebSocketSharp.Net /// A that represents the encoding for the entity body data, /// or if no encoding is specified. /// - /// - /// The response has already been sent. - /// /// /// This object is closed. /// @@ -133,17 +130,16 @@ namespace WebSocketSharp.Net } set { - checkDisposedOrHeadersSent (); + checkDisposed (); _contentEncoding = value; } } /// - /// Gets or sets the size of the entity body data included in the response. + /// Gets or sets the number of bytes in the entity body data included in the response. /// /// /// A that represents the value of the Content-Length entity-header. - /// The value is a number of bytes in the entity body data. /// /// /// The value specified for a set operation is less than zero. @@ -173,17 +169,13 @@ namespace WebSocketSharp.Net /// Gets or sets the media type of the entity body included in the response. /// /// - /// A that represents the value of the Content-Type entity-header. + /// A that represents the media type of the entity body, + /// or if no media type is specified. This value is + /// used for the value of the Content-Type entity-header. /// - /// - /// The value specified for a set operation is . - /// /// /// The value specified for a set operation is empty. /// - /// - /// The response has already been sent. - /// /// /// This object is closed. /// @@ -193,11 +185,8 @@ namespace WebSocketSharp.Net } set { - checkDisposedOrHeadersSent (); - if (value == null) - throw new ArgumentNullException ("value"); - - if (value.Length == 0) + checkDisposed (); + if (value != null && value.Length == 0) throw new ArgumentException ("An empty string.", "value"); _contentType = value;