Skip to content

Commit fc0db98

Browse files
committed
Fix web requests for repos not using icinga Cmdlet
1 parent 7795026 commit fc0db98

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

doc/100-General/10-Changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ documentation before upgrading to a new release.
77

88
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
99

10+
## 1.7.1 (2021-11-11)
11+
12+
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/22?closed=1)
13+
14+
### Bugfixes
15+
16+
* [#398](https://github.com/Icinga/icinga-powershell-framework/pull/398) Fixes String.Builder object output, while creating new components by using `New-IcingaForWindowsComponent`
17+
* [#401](https://github.com/Icinga/icinga-powershell-framework/pull/401) Fixes the repository manager by now using Icinga WebRequests instead of Windows WebRequests, allowing the usage of the internal proxy feature
18+
1019
## 1.7.0 (2021-11-09)
1120

1221
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/16?closed=1)

lib/core/repository/Read-IcingaRepositoryFile.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Read-IcingaRepositoryFile()
4949
$RepoPath = (Join-WebPath -Path $Repository.RemotePath -ChildPath 'ifw.repo.json');
5050
}
5151

52-
$WebContent = Invoke-WebRequest -UseBasicParsing -Uri $RepoPath;
52+
$WebContent = Invoke-IcingaWebRequest -UseBasicParsing -Uri $RepoPath;
5353

5454
if ($null -ne $WebContent) {
5555
if ($WebContent.RawContent.Contains('application/octet-stream')) {

lib/core/repository/Sync-IcingaRepository.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ function Sync-IcingaRepository()
9797
} else { # Sync Source is web path
9898
$ProgressPreference = "SilentlyContinue";
9999
try {
100-
Invoke-WebRequest -USeBasicParsing -Uri $Source -OutFile $RepoFile;
100+
Invoke-IcingaWebRequest -UseBasicParsing -Uri $Source -OutFile $RepoFile;
101101
} catch {
102102
try {
103-
Invoke-WebRequest -USeBasicParsing -Uri (Join-WebPath -Path $Source -ChildPath 'ifw.repo.json') -OutFile $RepoFile;
103+
Invoke-IcingaWebRequest -UseBasicParsing -Uri (Join-WebPath -Path $Source -ChildPath 'ifw.repo.json') -OutFile $RepoFile;
104104
} catch {
105105
Write-IcingaConsoleError 'Unable to download repository file from "{0}". Exception: "{1}"' -Objects $Source, $_.Exception.Message;
106106
$Success = Remove-Item -Path $TmpDir -Recurse -Force;
@@ -145,7 +145,7 @@ function Sync-IcingaRepository()
145145

146146
try {
147147
Write-IcingaConsoleNotice 'Syncing repository component "{0}" as file "{1}" into temp directory' -Objects $component, $package.Location;
148-
Invoke-WebRequest -USeBasicParsing -Uri $DownloadLink -OutFile $TargetLocation;
148+
Invoke-IcingaWebRequest -USeBasicParsing -Uri $DownloadLink -OutFile $TargetLocation;
149149
} catch {
150150
Write-IcingaConsoleError 'Failed to download repository component "{0}". Exception: "{1}"' -Objects $DownloadLink, $_.Exception.Message;
151151
continue;

0 commit comments

Comments
 (0)