Fix proxy type (#18166)

* Update configuration.mustache

Fix check of proxy type

* Changing sample source files
This commit is contained in:
condorcorde
2024-03-20 05:53:58 +01:00
committed by GitHub
parent 1108ce5808
commit de081e4edf
3 changed files with 6 additions and 6 deletions

View File

@@ -180,8 +180,8 @@ function Set-Configuration {
}
If ($null -ne $Proxy) {
If ($Proxy.GetType().FullName -ne "System.Net.SystemWebProxy" -and $Proxy.GetType().FullName -ne "System.Net.WebRequest+WebProxyWrapperOpaque") {
throw "Incorrect Proxy type '$($Proxy.GetType().FullName)'. Must be System.Net.SystemWebProxy or System.Net.WebRequest+WebProxyWrapperOpaque."
If ('System.Net.IWebProxy' -notin $Proxy.GetType().ImplementedInterfaces.FullName) {
throw "Incorrect Proxy type '$($Proxy.GetType().FullName)'. Must implement System.Net.IWebProxy interface."
}
$Script:Configuration['Proxy'] = $Proxy
} else {