From 40fa7236027026edb65ebe38b2413ac8e8980bf4 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 13 Oct 2020 13:58:22 -0400 Subject: [PATCH] Fix WinHttpHandler outerloop tests for deflate (#43305) --- .../System/Net/Http/HttpClientHandlerTest.Decompression.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index 2eac416..ae0384d 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -171,7 +171,7 @@ namespace System.Net.Http.Functional.Tests [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersAndCompressionUris))] - public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed(Configuration.Http.RemoteServer remoteServer, Uri uri) + public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_GZip(Configuration.Http.RemoteServer remoteServer, Uri uri) { // Sync API supported only up to HTTP/1.1 if (!TestAsync && remoteServer.HttpVersion.Major >= 2) @@ -205,10 +205,14 @@ namespace System.Net.Http.Functional.Tests [Theory] [InlineData("http://httpbin.org/deflate", "\"deflated\": true")] [InlineData("https://httpbin.org/deflate", "\"deflated\": true")] - [InlineData("http://httpbin.org/gzip", "\"gzipped\": true")] - [InlineData("https://httpbin.org/gzip", "\"gzipped\": true")] - public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed(string uri, string expectedContent) + public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_Deflate(string uri, string expectedContent) { + if (IsWinHttpHandler) + { + // WinHttpHandler targets netstandard2.0 and still erroneously uses DeflateStream rather than ZlibStream for deflate. + return; + } + HttpClientHandler handler = CreateHttpClientHandler(); handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; using (HttpClient client = CreateHttpClient(handler)) -- 2.7.4