Пример #1
0
        private void WriteBeginResponseHeaders(WritableBuffer buffer)
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;

            buffer.Write(_http11Bytes);
            var status = ReasonPhrases.ToStatusBytes(StatusCode);

            buffer.Write(status);

            _autoChunk = !HasContentLength && !HasTransferEncoding && KeepAlive;

            ResponseHeaders.CopyTo(_autoChunk, buffer);
        }
Пример #2
0
        private void WriteBeginResponseHeaders()
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;
            
            if (_isHttp2)
            {
                throw new NotImplementedException();
            }
            else
            {
                _outputFormatter.Write(_http11Bytes);
                var status = ReasonPhrases.ToStatusBytes(StatusCode);
                _outputFormatter.Write(status);

                _autoChunk = !HasContentLength && !HasTransferEncoding && KeepAlive;

                ResponseHeaders.CopyTo(_autoChunk, _outputFormatter);
            }
        }