[Modify] Replace it

This commit is contained in:
sta 2019-07-03 20:35:49 +09:00
parent 6e0962ce69
commit 5c487003c6

View File

@ -153,9 +153,18 @@ namespace WebSocketSharp
internal string Reason { internal string Reason {
get { get {
if (!_reasonSet) { if (!_reasonSet) {
_reason = _length > 2 if (_length > 2) {
? _data.SubArray (2, _length - 2).UTF8Decode () var raw = _data.SubArray (2, _length - 2);
: String.Empty;
string reason;
if (!raw.TryGetUTF8DecodedString (out reason))
reason = String.Empty;
_reason = reason;
}
else {
_reason = String.Empty;
}
_reasonSet = true; _reasonSet = true;
} }