Skip to content

Commit

Permalink
(GH-957) Skip Get-WebFileName When FTP
Browse files Browse the repository at this point in the history
Do not attempt to get the original file name over http when the url is
FTP.
  • Loading branch information
ferventcoder committed Sep 11, 2016
1 parent de6260c commit 27d6e39
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ param(

Write-Debug "Running 'Get-WebFileName' to determine name with url:'$url', defaultName:'$defaultName'";


$originalFileName = $defaultName
$fileName = $null

Expand All @@ -95,6 +94,11 @@ param(
#continue on
}

if ($url.StartsWith('ftp')) {
Write-Debug "Url is FTP, using default name."
return $originalFileName
}

$request = [System.Net.HttpWebRequest]::Create($url)
if ($request -eq $null) {
Write-Debug "Request was null, using default name."
Expand Down

0 comments on commit 27d6e39

Please sign in to comment.