choco icon indicating copy to clipboard operation
choco copied to clipboard

(#3191) Pass options to Get-WebHeaders

Open flcdrg opened this issue 1 year ago • 1 comments

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 Headers collection.

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

flcdrg avatar Feb 12 '24 08:02 flcdrg

This may also possibly resolve https://github.com/chocolatey/chocolatey-licensed-issues/issues/372

flcdrg avatar Sep 18 '24 07:09 flcdrg

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"

pfremy avatar Dec 16 '24 16:12 pfremy

@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?

pauby avatar May 12 '25 19:05 pauby

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.

vexx32 avatar May 15 '25 21:05 vexx32