Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pkgs passing custom headers via custom Net.WebClient object #125

Open
dtgm opened this issue Feb 20, 2016 · 4 comments
Open

update pkgs passing custom headers via custom Net.WebClient object #125

dtgm opened this issue Feb 20, 2016 · 4 comments

Comments

@dtgm
Copy link
Owner

dtgm commented Feb 20, 2016

Deprecate custom WebClient code

Currently, 29 packages are passing referer headers like:

https://github.com/dtgm/chocolatey-packages/blob/master/automatic/nirlauncher/tools/chocolateyInstall.ps1#L13-L16

$referer = "http://launcher.nirsoft.net/download.html"
$wc = New-Object System.Net.WebClient
$wc.Headers.Add("Referer", $referer)
$wc.DownloadFile($url, $zipFile)

Update to Chocolatey header method

pass custom headers via hashtable

https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1#L17-L24

function Get-WebFile {
param(
  $url = '', #(Read-Host "The URL to download"),
  $fileName = $null,
  $userAgent = 'chocolatey command line',
  [switch]$Passthru,
  [switch]$quiet,
  [hashtable] $options = @{Headers=@{}}
@dtgm
Copy link
Owner Author

dtgm commented Feb 20, 2016

affected packages

$ grep -li 'headers.add' */tools/*.ps1
chromepass/tools/chocolateyInstall.ps1
datacrow/tools/Get-UrlFromFosshub.ps1
ddu/tools/chocolateyInstall.ps1
dialupass/tools/chocolateyInstall.ps1
iepv.install/tools/chocolateyInstall.ps1
iepv.portable/tools/chocolateyInstall.ps1
irfanview/tools/Get-UrlFromFosshub.ps1
lsasecretsdump/tools/chocolateyInstall.ps1
lsasecretsview/tools/chocolateyInstall.ps1
mailpv.install/tools/chocolateyInstall.ps1
mailpv.portable/tools/chocolateyInstall.ps1
mspass.install/tools/chocolateyInstall.ps1
mspass.portable/tools/chocolateyInstall.ps1
netpass.install/tools/chocolateyInstall.ps1
netpass.portable/tools/chocolateyInstall.ps1
nirlauncher/tools/chocolateyInstall.ps1
operapassview/tools/chocolateyInstall.ps1
passwordfox/tools/chocolateyInstall.ps1
pspv/tools/chocolateyInstall.ps1
pstpassword.install/tools/chocolateyInstall.ps1
pstpassword.portable/tools/chocolateyInstall.ps1
rdpv/tools/chocolateyInstall.ps1
routerpassview/tools/chocolateyInstall.ps1
sniffpass.portable/tools/chocolateyInstall.ps1
speedfan/tools/chocolateyInstall.ps1
vncpassview/tools/chocolateyInstall.ps1
webbrowserpassview.install/tools/chocolateyInstall.ps1
webbrowserpassview.portable/tools/chocolateyInstall.ps1
wirelesskeyview/tools/chocolateyInstall.ps1

@ferventcoder
Copy link

As soon as these are pushed, they will need 0.9.10+ version of Chocolatey to continue working for folks. What we can do are two things. Set up an extension these can depend on, or set a choco dependency on a particular version once it is released.

@dtgm
Copy link
Owner Author

dtgm commented Feb 20, 2016

do you have stats on what versions of chocolatey users are using? that may give a good idea about which course would be better.

@ferventcoder
Copy link

I think we will want to add an extension. I will work on this bit, because I want it to automatically remove itself on 0.9.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants