diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index 4d10f1d0..8ac1ceac 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -282,8 +282,12 @@ namespace WebSocketSharp.Net /// public Stream InputStream { get { - if (_inputStream == null) - _inputStream = getInputStream () ?? Stream.Null; + if (_inputStream == null) { + _inputStream = _contentLength > 0 || _chunked + ? _connection + .GetRequestStream (_contentLength, _chunked) + : Stream.Null; + } return _inputStream; }