Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-649) Write Small File When Download Type Text
  (GH-647)(GH-374) Update shimgen.exe
  (maint) update redirect shims
  • Loading branch information
ferventcoder committed Mar 2, 2016
2 parents 66abe26 + 74aa4e6 commit 0f2c5aa
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/chocolatey.resources/helpers/functions/Get-WebFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ param(

$res = $req.GetResponse();

try {
$headers = @{}
foreach ($key in $res.Headers) {
$value = $res.Headers[$key];
if ($value) {
$headers.Add("$key","$value")
}
}

if ($headers.ContainsKey("Content-Type")) {
$contentType = $headers['Content-Type']
if ($contentType -ne $null) {
if ($contentType.ToLower().Contains("text/html") -or $contentType.ToLower().Contains("text/plain")) {
Write-Warning "$fileName is of content type $contentType"
Set-Content -Path "$fileName.istext" -Value "$fileName has content type $contentType" -Encoding UTF8 -Force
}
}
}
} catch {
# not able to get content-type header
Write-Debug "Error getting content type - $($_.Exception.Message)"
}

if($fileName -and !(Split-Path $fileName)) {
$fileName = Join-Path (Get-Location -PSProvider "FileSystem") $fileName
}
Expand Down
Binary file modified src/chocolatey.resources/redirects/choco.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/chocolatey.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cinst.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/clist.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cpack.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cpush.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cuninst.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cup.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/redirects/cver.exe
Binary file not shown.
Binary file modified src/chocolatey.resources/tools/shimgen.exe
Binary file not shown.

0 comments on commit 0f2c5aa

Please sign in to comment.