Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Support for custom headers downloading files #171

Closed
wants to merge 3 commits into from

Conversation

ewilde
Copy link

@ewilde ewilde commented Sep 22, 2012

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';
   }   
}

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

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

Now support an options hashtable which allows use to specify individual
headers.
@ferventcoder
Copy link
Contributor

Thanks - still discussing this in the other issue. :D

@rismoney
Copy link
Contributor

This PR and the associated #164 haven't been updated in 7 months. Can we take this in as an advanced user improvement, that if someone down the line wants to simplify and improve, it can be part of a refactor? I think there is value in the code.

I'd probably fixup the commits and amend the commit msg, to be inclusive of the others.

@ferventcoder
Copy link
Contributor

I don't want them updated. When I roll these in, I branch to a new section, then I back that branch to the parent commit of this. Then I pull the changes. Then I rebase against all of the current. And if all goes well (usually does), I just merge back to master.

It keeps the commit history a nice straight line. Don't think of commit history so linearly ;)

@rismoney
Copy link
Contributor

your the boss ;) how do you back that branch to the parent commit and then pull the changes. I was just trying to assist as I know there are a ton of PRs and don't want to stifle progress for project newcomers who think they won't get merged. However I can help, let me know.

@ferventcoder
Copy link
Contributor

For me, if someone is willing to keep their PR up to date, I'm okay with
that (if they do it without creating multiple lines of history).

But when it takes awhile for a project team to evaluate PRs, it should not
be on the person who took the time to create the patch in the first place.
It should be the responsibility of the project team. I've submitted PRs
before where this happened a few times. I felt is was kind of against
etiquette of the project team to have an expectation for me to keep up with
them when they were taking their time to evaluating my request.

I don't want to create this same feeling on chocolatey as it doesn't really
create a feeling of community. If we wait awhile before evaluating
requests, that is on us and we should be feeling a little pain (if there is
some) rather than the person who is taking time to contribute to our
project.

Does that make sense?

On Friday, April 19, 2013, Rich Siegel wrote:

your the boss ;) how do you back that branch to the parent commit and then
pull the changes. I was just trying to assist as I know there are a ton of
PRs and don't want to stifle progress for project newcomers who think they
won't get merged. However I can help, let me know.


Reply to this email directly or view it on GitHubhttps://github.com//pull/171#issuecomment-16656891
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@ferventcoder
Copy link
Contributor

As far as backing, you can find the parent commit a few ways... I just pull
the changes into a branch and look over history to find it. Then back the
branch up to that and pull the changes again.

On Friday, April 19, 2013, Rich Siegel wrote:

your the boss ;) how do you back that branch to the parent commit and then
pull the changes. I was just trying to assist as I know there are a ton of
PRs and don't want to stifle progress for project newcomers who think they
won't get merged. However I can help, let me know.


Reply to this email directly or view it on GitHubhttps://github.com//pull/171#issuecomment-16656891
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@ferventcoder
Copy link
Contributor

Need to start looking at this one for the release after this one.

@patrickmaurer
Copy link

I think this additional options would make a great improvement to the affected helpers. Does the MoveToChoco label mean that it should be ported to the new chocolatey/choco repository? I could volunteer to do this if you wan't, just let me know.

@ferventcoder
Copy link
Contributor

Yeah, I was slowly going through and tagging things we want to move. This particular thing is planned as we rewrite the helpers into compiled powershell cmd-lets.

@ferventcoder
Copy link
Contributor

This was fixed in choco for 0.9.10 chocolatey/choco#332

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

Successfully merging this pull request may close these issues.

4 participants