Skip to content

Commit 1ce2d65

Browse files
authored
Merge pull request #72 from libgit2/ethomson/downloadartifacts
download artifacts: disable header validation
2 parents 846512c + 93d78fb commit 1ce2d65

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

download.build.artifacts.and.package.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Param(
66
Set-StrictMode -Version Latest
77
$ErrorActionPreference = "Stop"
88

9+
$PSDefaultParameterValues['Invoke-RestMethod:SkipHeaderValidation'] = $true
10+
$PSDefaultParameterValues['Invoke-WebRequest:SkipHeaderValidation'] = $true
11+
912
function Invoke-RestMethod-Ex($url, $downloadLocation) {
1013
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
1114

@@ -29,7 +32,7 @@ function Invoke-RestMethod-Ex($url, $downloadLocation) {
2932
$irmParams.OutFile = "$downloadLocation"
3033
}
3134

32-
$output = Invoke-RestMethod @irmParams -ContentType "application/json" -Method "Get" -Uri "$url"
35+
$output = Invoke-RestMethod @irmParams -Method "Get" -Uri "$url"
3336

3437
if ($verbose) {
3538
Write-Host -ForegroundColor "Gray" "output = $(ConvertTo-Json $output)"

0 commit comments

Comments
 (0)