Ejemplo n.º 1
0
        public async Task ManuallySettingTransferEncodingThrowsForHeadResponse()
        {
            // Arrange
            _http1Connection.HttpVersion = "HTTP/1.1";
            ((IHttpRequestFeature)_http1Connection).Method = "HEAD";

            // Act
            _http1Connection.ResponseHeaders.Add("Transfer-Encoding", "chunked");

            // Assert
            await Assert.ThrowsAsync <InvalidOperationException>(() => _http1Connection.FlushAsync());
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _http1Connection.Reset();

            _http1Connection.RequestHeaders.ContentLength = _readData.Length;

            if (!WithHeaders)
            {
                _http1Connection.FlushAsync().GetAwaiter().GetResult();
            }

            ResetState();
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            _http1Connection.Reset();
            if (Chunked)
            {
                _http1Connection.RequestHeaders.Add("Transfer-Encoding", "chunked");
            }
            else
            {
                _http1Connection.RequestHeaders.ContentLength = _writeData.Length;
            }

            if (!WithHeaders)
            {
                _http1Connection.FlushAsync().GetAwaiter().GetResult();
            }

            ResetState();
        }
Ejemplo n.º 4
0
 public void Setup()
 {
     _http1Connection.Reset();
     _http1Connection.RequestHeaders.ContentLength = _writeData.Length;
     _http1Connection.FlushAsync().GetAwaiter().GetResult();
 }