From d254b82348fd7f5f0a86e834fa146e5a8401e827 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Wed, 28 Aug 2024 09:42:03 -0700 Subject: [PATCH] Fix proxy url handling --- src/GitlabCli/GitlabCli.psd1 | 2 +- src/GitlabCli/Utilities.psm1 | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GitlabCli/GitlabCli.psd1 b/src/GitlabCli/GitlabCli.psd1 index 9e669e7..b3ec9dc 100644 --- a/src/GitlabCli/GitlabCli.psd1 +++ b/src/GitlabCli/GitlabCli.psd1 @@ -1,5 +1,5 @@ @{ - ModuleVersion = '1.117.0' + ModuleVersion = '1.117.1' RequiredModules = @('powershell-yaml') diff --git a/src/GitlabCli/Utilities.psm1 b/src/GitlabCli/Utilities.psm1 index b1a19c7..1df5c9a 100644 --- a/src/GitlabCli/Utilities.psm1 +++ b/src/GitlabCli/Utilities.psm1 @@ -138,10 +138,13 @@ function Invoke-GitlabApi { Method = $HttpMethod Uri = "$GitlabUrl/api/$Api/$Path$SerializedQuery" Header = $Headers - Proxy = $ProxyUrl ?? $Site.ProxyUrl + } + $Proxy = $ProxyUrl ?? $Site.ProxyUrl + if (-not [string]::IsNullOrWhiteSpace($Proxy)) { + Write-Verbose "Using proxy $Proxy" } if($MaxPages -gt 1) { - $RestMethodParams.FollowRelLink = $true + $RestMethodParams.FollowRelLink = $true $RestMethodParams.MaximumFollowRelLink = $MaxPages } if ($Body.Count -gt 0) {