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

Support for custom headers downloading files #332

Closed
ewilde opened this issue Jun 16, 2015 · 1 comment
Closed

Support for custom headers downloading files #332

ewilde opened this issue Jun 16, 2015 · 1 comment
Assignees
Milestone

Comments

@ewilde
Copy link
Contributor

ewilde commented Jun 16, 2015

Some web sites require specific headers to allow you to download the
setup program/zip

functions:
Get-WebFile.ps1
Get-ChocolateyWebFile.ps1
Install-ChocolateyPackage.ps1
Install-ChocolateyZipPackage.ps1

now support an options hashtable which allows use to specify individual
headers.

The options hash table structure allows for future settings to be flowed through the application without updating multiple method signatures.

The structure at the moment is:

$options = @ {
Headers = @{
Header1 = 'somevalue'; Header2 = 'somevalue'
}
}
In the future you could use the options to pass down cookies by domain for example

$options = @ {
Headers = @{
Header1 = 'somevalue'; Header2 = 'somevalue'
};
Cookies = @{
'http://domain.com' = 'value1';
'http://secure.domain.com = 'value2';
}
}

I have a PR in the works for this

ewilde added a commit to ewilde/choco that referenced this issue Jun 16, 2015
Adds the ability for packages that use Get-ChocolateyWebFile.ps1 or
Get-WebFile to specify customer headers during the request. See chocolatey#332 or
powershell documentation for example usage
ewilde added a commit to ewilde/choco that referenced this issue Jun 16, 2015
Adds the ability for packages that use Get-ChocolateyWebFile.ps1 or
Get-WebFile to specify customer headers during the request. See chocolatey#332 or
powershell documentation for example usage
ferventcoder added a commit that referenced this issue Jun 18, 2015
@ferventcoder ferventcoder self-assigned this Jun 18, 2015
@ferventcoder ferventcoder added this to the 0.9.10 milestone Jun 18, 2015
@ferventcoder
Copy link
Member

This will be released in 0.9.10

ferventcoder added a commit that referenced this issue Jan 24, 2016
ferventcoder added a commit that referenced this issue Jan 24, 2016
* stable:
  (GH-332) Fixup example
  (GH-562) Download Cache is sha512
  (doc) updating the submitting issues section
  (maint) move readme template to top level
  (GH-476) Verbose log file operations / checksum

# Conflicts:
#	CONTRIBUTING.md
ferventcoder added a commit that referenced this issue Jan 28, 2016
ferventcoder added a commit that referenced this issue Jan 28, 2016
* stable:
  (GH-435) Use Original Download File Name
  (GH-332) Fixup example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants