(#3191) Pass options to Get-WebHeaders
Description Of Changes
Pass $options through to Get-WebFileName and Get-WebHeaders
- For remaining headers that don't require special support, check that they aren't 'restricted' before adding them to the
Headerscollection.
Motivation and Context
Allows being able to set headers via functions like Install-ChocolateyPackage and ensure that those headers are used appropriately.
Testing
Operating Systems Testing
Change Types Made
- [ ] Bug fix (non-breaking change).
- [x] Feature / Enhancement (non-breaking change).
- [ ] Breaking change (fix or feature that could cause existing functionality to change).
- [ ] Documentation changes.
- [x] PowerShell code changes.
Change Checklist
- [ ] Requires a change to the documentation.
- [ ] Documentation has been updated.
- [ ] Tests to cover my changes, have been added.
- [x] All new and existing tests passed?
- [ ] PowerShell code changes: PowerShell v2 compatibility checked?
Related Issue
Fixes #3191
This may also possibly resolve https://github.com/chocolatey/chocolatey-licensed-issues/issues/372
I have use for that change too
Or any way to provide implicitely user credentials for some url, in the same principle as is done with "source"
@vexx32 can you confirm if this one is a duplicate of this one and close whichever one you need to? Can you add this to do under #3477 and do we still need it open?
Yeah, I think the rewrite will be a good time to do that change as well.
Thanks for the contribution here @flcdrg! I do agree this is a change that is needed, but we are progressing through a total rewrite of many / all of these helper commands, so for the moment I don't think it makes sense to accept this contribution as it stands. I will make a note on #3477 to ensure the changes here are incorporated into the rewrite when these commands are rewritten in the coming months.