private async Task AltSvc_Upgrade_Success(GenericLoopbackServer firstServer, Http3LoopbackServer secondServer, HttpClient client)
        {
            Task <HttpResponseMessage> secondResponseTask = client.GetAsync(firstServer.Address);

            HttpRequestData secondRequest = await secondServer.AcceptConnectionSendResponseAndCloseAsync();

            string altUsed = secondRequest.GetSingleHeaderValue("Alt-Used");

            Assert.Equal($"{secondServer.Address.IdnHost}:{secondServer.Address.Port}", altUsed);

            HttpResponseMessage secondResponse = await secondResponseTask;

            Assert.True(secondResponse.IsSuccessStatusCode);
        }
예제 #2
0
        private async Task AltSvc_Upgrade_Success(GenericLoopbackServer firstServer, Http3LoopbackServer secondServer, HttpClient client)
        {
            Task <HttpResponseMessage> secondResponseTask = client.GetAsync(firstServer.Address);
            Task <HttpRequestData>     secondRequestTask  = secondServer.AcceptConnectionSendResponseAndCloseAsync();

            await new[] { (Task)secondResponseTask, secondRequestTask }.WhenAllOrAnyFailed(30_000);

            HttpRequestData secondRequest = secondRequestTask.Result;

            using HttpResponseMessage secondResponse = secondResponseTask.Result;

            string altUsed = secondRequest.GetSingleHeaderValue("Alt-Used");

            Assert.Equal($"{secondServer.Address.IdnHost}:{secondServer.Address.Port}", altUsed);
            Assert.True(secondResponse.IsSuccessStatusCode);
        }