From a3173f181a5d7aadbebdd78ae1aa6770c42c60ea Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 6 Mar 2017 20:50:29 +0100 Subject: [PATCH 1/2] (GH-1056) Add support for automatic decompression to Get-WebFile --- src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 index 29fe036929..ce43ece54c 100644 --- a/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 @@ -122,7 +122,7 @@ param( $explicitProxy = $env:chocolateyProxyLocation $explicitProxyUser = $env:chocolateyProxyUser $explicitProxyPassword = $env:chocolateyProxyPassword - $explicitProxyBypassList = $env:chocolateyProxyBypassList + $explicitProxyBypassList = $env:chocolateyProxyBypassList $explicitProxyBypassOnLocal = $env:chocolateyProxyBypassOnLocal if ($explicitProxy -ne $null) { # explicit proxy @@ -159,6 +159,7 @@ param( $req.AllowAutoRedirect = $true $req.MaximumAutomaticRedirections = 20 #$req.KeepAlive = $true + $req.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate $req.Timeout = 30000 if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') { Write-Debug "Setting request timeout to $env:chocolateyRequestTimeout" From 01af07dba08ed83408a8776e58faab5ae7e33936 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 9 Mar 2017 16:44:09 -0600 Subject: [PATCH 2/2] (GH-1056) Support auto decompression for Headers When grabbing web headers and the remote file name, also support automatic decompression to match what is done for Get-WebFile. --- src/chocolatey.resources/helpers/functions/Get-WebFileName.ps1 | 1 + src/chocolatey.resources/helpers/functions/Get-WebHeaders.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/src/chocolatey.resources/helpers/functions/Get-WebFileName.ps1 b/src/chocolatey.resources/helpers/functions/Get-WebFileName.ps1 index 334d709da8..0bf06577ed 100644 --- a/src/chocolatey.resources/helpers/functions/Get-WebFileName.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-WebFileName.ps1 @@ -158,6 +158,7 @@ param( $request.AllowAutoRedirect = $true $request.MaximumAutomaticRedirections = 20 #$request.KeepAlive = $true + $request.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate $request.Timeout = 30000 if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') { $request.Timeout = $env:chocolateyRequestTimeout diff --git a/src/chocolatey.resources/helpers/functions/Get-WebHeaders.ps1 b/src/chocolatey.resources/helpers/functions/Get-WebHeaders.ps1 index 17d77033e3..c1bfdbf4e0 100644 --- a/src/chocolatey.resources/helpers/functions/Get-WebHeaders.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-WebHeaders.ps1 @@ -114,6 +114,7 @@ param( $request.AllowAutoRedirect = $true $request.MaximumAutomaticRedirections = 20 #$request.KeepAlive = $true + $request.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate $request.Timeout = 30000 if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') { $request.Timeout = $env:chocolateyRequestTimeout