[Modify] Replace it

This commit is contained in:
sta 2018-02-01 16:38:52 +09:00
parent f4ae8ab1da
commit 7dfc648895

View File

@ -165,7 +165,10 @@ namespace WebSocketSharp.Net
/// </value> /// </value>
public Encoding ContentEncoding { public Encoding ContentEncoding {
get { get {
return _contentEncoding ?? Encoding.UTF8; if (_contentEncoding == null)
_contentEncoding = getContentEncoding () ?? Encoding.UTF8;
return _contentEncoding;
} }
} }
@ -623,17 +626,6 @@ namespace WebSocketSharp.Net
_contentLength = len; _contentLength = len;
return; return;
} }
if (lower == "content-type") {
try {
_contentEncoding = HttpUtility.GetEncoding (val);
}
catch {
_context.ErrorMessage = "Invalid Content-Type header";
}
return;
}
} }
internal void FinishInitialization () internal void FinishInitialization ()