Skip to content

Commit

Permalink
Update PSTcpIp.psm1
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyg-1 authored Sep 26, 2024
1 parent ea2eda4 commit 8aa7805
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PSTcpIp/PSTcpIp.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,12 @@ function Get-HttpResponseHeader {
Write-Error -Exception $ArgumentException -Category InvalidArgument -ErrorAction $ErrorActionPreference
}

$uriString = "{0}://{1}:{2}" -f $ProtocolScheme.ToLower(), $HostName, $Port
$targetPort = $Port
if (($PSBoundParameters.ContainsKey("ProtocolScheme")) -and ($ProtocolScheme.ToLower() -eq "http") -and (-not($PSBoundParameters.ContainsKey("Port")))) {
$targetPort = 80
}

$uriString = "{0}://{1}:{2}" -f $ProtocolScheme.ToLower(), $HostName, $targetPort
$targetUri = [System.Uri]::new($uriString)
}
else {
Expand Down

0 comments on commit 8aa7805

Please sign in to comment.