Exemplo n.º 1
0
        public Task HandleCallAsync()
        {
            _httpContext.Response.Headers.Clear();
            _requestStream.Seek(0, SeekOrigin.Begin);
            _trailers.Clear();

            return(_callHandler.HandleCallAsync(_httpContext));
        }
Exemplo n.º 2
0
        protected Task InvokeUnaryRequestAsync()
        {
            _httpContext.Response.Headers.Clear();
            _trailers.Clear();
            _requestPipe.ReadResults.Add(new ValueTask <ReadResult>(new ReadResult(new ReadOnlySequence <byte>(_requestMessage), false, true)));

            return(_callHandler.HandleCallAsync(_httpContext));
        }
        public Task HandleCallAsync()
        {
            _httpContext.Response.Headers.Clear();
            ResetRequest();
            _trailers.Clear();

            return(_callHandler.HandleCallAsync(_httpContext));
        }
Exemplo n.º 4
0
    public void WriteActionsThrowWhenReadOnly()
    {
        var headers = new HeaderDictionary();

        headers.IsReadOnly = true;

        Assert.Throws <InvalidOperationException>(() => headers["header1"] = "value1");
        Assert.Throws <InvalidOperationException>(() => ((IDictionary <string, StringValues>)headers)["header1"] = "value1");
        Assert.Throws <InvalidOperationException>(() => headers.ContentLength = 12);
        Assert.Throws <InvalidOperationException>(() => headers.Add(new KeyValuePair <string, StringValues>("header1", "value1")));
        Assert.Throws <InvalidOperationException>(() => headers.Add("header1", "value1"));
        Assert.Throws <InvalidOperationException>(() => headers.Clear());
        Assert.Throws <InvalidOperationException>(() => headers.Remove(new KeyValuePair <string, StringValues>("header1", "value1")));
        Assert.Throws <InvalidOperationException>(() => headers.Remove("header1"));
    }
 public void Clear()
 {
     _headers.Clear();
 }