From c1bb738b5347de9ee2854345a29f2a9e1aa239ec Mon Sep 17 00:00:00 2001 From: Geoff Kizer Date: Tue, 9 Jul 2019 16:59:44 -0700 Subject: [PATCH] fix NETFX and UWP build issues Commit migrated from https://github.com/dotnet/corefx/commit/b2216d60d2a2f9416eadb4bae015eb1524407d71 --- src/libraries/Common/tests/System/Net/Configuration.Http.cs | 2 +- .../tests/HttpHandlerDiagnosticListenerTests.cs | 4 ++-- .../tests/FunctionalTests/PostScenarioUWPTest.cs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Configuration.Http.cs b/src/libraries/Common/tests/System/Net/Configuration.Http.cs index 2d38bdb..a1417d3 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Http.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Http.cs @@ -78,7 +78,7 @@ namespace System.Net.Test.Common public static readonly RemoteServer RemoteHttp11Server = new RemoteServer(new Uri("http://" + Host + "/"), HttpVersion.Version11); public static readonly RemoteServer RemoteSecureHttp11Server = new RemoteServer(new Uri("https://" + SecureHost + "/"), HttpVersion.Version11); - public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), HttpVersion.Version20); + public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), new Version(2, 0)); public static readonly IEnumerable RemoteServers = new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server }; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs index e72664e..f0a1aea 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs @@ -334,7 +334,7 @@ namespace System.Diagnostics.Tests using (var client = new HttpClient()) { Uri uriWithRedirect = - Configuration.Http.RedirectUriForDestinationUri(true, 302, Configuration.Http.RemoteEchoServer, 10); + Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, Configuration.Http.RemoteEchoServer, 10); (await client.GetAsync(uriWithRedirect)).Dispose(); } @@ -550,7 +550,7 @@ namespace System.Diagnostics.Tests for (int i = 0; i < 10; i++) { Uri uriWithRedirect = - Configuration.Http.RedirectUriForDestinationUri(true, 302, new Uri($"{Configuration.Http.RemoteEchoServer}?q={i}"), 3); + Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, new Uri($"{Configuration.Http.RemoteEchoServer}?q={i}"), 3); requestData[uriWithRedirect] = null; } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs index 6834109..3787f49 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs @@ -30,7 +30,7 @@ namespace System.Net.Http.Functional.Tests // re-POST'd to the server. string username = "testuser"; string password = "password"; - Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password); + Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password); HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String); handler.Credentials = new NetworkCredential(username, password); @@ -54,7 +54,7 @@ namespace System.Net.Http.Functional.Tests { string username = "testuser"; string password = "password"; - Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password); + Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password); HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String); handler.Credentials = new NetworkCredential(username, password); @@ -78,7 +78,7 @@ namespace System.Net.Http.Functional.Tests { string username = "testuser"; string password = "password"; - Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password); + Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password); HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String); handler.Credentials = new NetworkCredential(username, password); @@ -106,7 +106,7 @@ namespace System.Net.Http.Functional.Tests { string username = "testuser"; string password = "password"; - Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password); + Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password); HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String); handler.Credentials = new NetworkCredential(username, password); @@ -134,7 +134,7 @@ namespace System.Net.Http.Functional.Tests { string username = "testuser"; string password = "password"; - Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password); + Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password); HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String); handler.Credentials = new NetworkCredential(username, password); -- 2.7.4