Skip to content

(#3191) Pass custom headers to web metadata requests#3921

Open
wtg-mg8 wants to merge 1 commit into
chocolatey:developfrom
wtg-mg8:Get-WebHeaders-uses-custom-request-headers
Open

(#3191) Pass custom headers to web metadata requests#3921
wtg-mg8 wants to merge 1 commit into
chocolatey:developfrom
wtg-mg8:Get-WebHeaders-uses-custom-request-headers

Conversation

@wtg-mg8

@wtg-mg8 wtg-mg8 commented Jul 14, 2026

Copy link
Copy Markdown

Description Of Changes

Forward Options.Headers from Get-ChocolateyWebFile to Get-WebHeaders and Get-WebFileName so authenticated endpoints work during probing.

Add a Pester regression test covering metadata and download requests.

GPT5.6 generated, human reviewed.

Motivation and Context

See issue #3919 (Duplicate of #3191)

Testing

Tested locally by executing the powershell test directly, functionally testing that it works against our own endpoint and running the entire pester suite.

Tested using Powershell v3 and Powershell v5.

Operating Systems Testing

Tested on Windows 11.

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked? Changes to the exported functions are compatible according to syntax checking using Powershell v2. Test suite is not compatible, as it uses Pester v5 syntax, which needs Powershell v5.1.
  • All items are complete on the Definition of Done.

Related Issue

Fixes #3191 (and duplicate that I originally raised: #3919)

Forward Options.Headers from Get-ChocolateyWebFile to Get-WebHeaders
and Get-WebFileName so authenticated endpoints work during probing.

Add a Pester regression test covering metadata and download requests.

GPT5.6 generated, human reviewed.
@wtg-mg8 wtg-mg8 changed the title (#3919) Pass custom headers to web metadata requests (#3191) Pass custom headers to web metadata requests Jul 21, 2026
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

Successfully merging this pull request may close these issues.

Get-ChocolateyWebFile should pass the Options parameter to Get-WebFileName and Get-WebHeaders

1 participant