Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Refresh options headers downloading multiple files #219

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

dgalbraith
Copy link
Contributor

Headers defined in options are injected into the WebClient instance used to
download files. This is done to support downloading files where headers
are required eg. Referrer. The headers can be defined and injected via
$Latest.Options.Headers.

The headers are cleared when a download is performed with DownloadFile
so where multiple files are downlaoded the headers are not available for
the second download. This impacts when a package requries both 32-bit
and 64-bit files to be downloaded during package construction.

To address this the headers should be injected prior to each download to
ensure that they are available.

Resolves #218

Headers defined in options are injected into the WebClient instance used to
download files.  This is done to support downloading files where headers
are required eg. REFERRER.  The headers can be defined and injected via
$Latest.Options.Headers.

The headers are cleared when a download is performed with DownloadFile
so where multiple files are downlaoded the headers are not available for
the second download.  This impacts when a package requries  both 32-bit
and 64-bit files to be downloaded during package construction.

To address this the headers should be injected prior to each download to
ensure that they are available.
@majkinetor majkinetor merged commit 98e250f into majkinetor:master Aug 21, 2020
@majkinetor
Copy link
Owner

Thanks @dgalbraith

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

Successfully merging this pull request may close these issues.

Refresh options headers when downloading multiple files with Get-RemoteFiles
2 participants