From 27b4b651bb1d659bccae223e067c07a565a9042c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Rom=C3=A1n?= Date: Thu, 15 Sep 2022 14:45:04 -0700 Subject: [PATCH] feat(checkurls): Allow checking URLs from private_hosts --- bin/checkurls.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/checkurls.ps1 b/bin/checkurls.ps1 index 733858e875..0335998c20 100644 --- a/bin/checkurls.ps1 +++ b/bin/checkurls.ps1 @@ -62,6 +62,13 @@ function test_dl([String] $url, $cookies) { $wreq.Headers.Add('Cookie', (cookie_header $cookies)) } } + + get_config 'private_hosts' | Where-Object { $_ -ne $null -and $url -match $_.match } | ForEach-Object { + (ConvertFrom-StringData -StringData $_.Headers).GetEnumerator() | ForEach-Object { + $wreq.Headers[$_.Key] = $_.Value + } + } + $wres = $null try { $wres = $wreq.GetResponse()