Save-WebFile: curl download fails in WinPE proxy environment while Invoke-WebRequest works
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- powershell
- Ambito
- backend
Direzione di ricerca
Start with Public\Functions\Save-WebFile.ps1 and trace how Save-WebFile selects the WebClient and curl branches, including the header request and download command. Reproduce the reported failure in WinPE with a proxy, then compare it with the Invoke-WebRequest download that succeeds. Done means the download works through the WinPE proxy with a consistent configuration or a usable option to select the download method.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When using Save-WebFile from OSD 26.10.16.1 during the WinPE phase in a proxy environment, the download through curl.exe does not work.
Replacing the curl download command with Invoke-WebRequest allows the download to work in this environment.
The function already uses Invoke-WebRequest to retrieve the HTTP headers in the curl branch, but then uses curl.exe for the actual download. These two clients may use different proxy configurations.
To Reproduce
-
Boot into WinPE in an environment where internet access requires a proxy.
-
Load OSD 26.10.16.1.
-
Run
Save-WebFileto download a file, taking the curl download branch. -
The download through
curl.exefails. -
Replace the
$curlCommandExpressionassignment with:$curlCommandExpression = "iwr -uri `"$SourceUrl`" -outfile `"$DestinationFullName`" -UseBasicParsing" -
Repeat the download. It works using
Invoke-WebRequest.
Expected behavior
Save-WebFile should download files reliably through the proxy available in the WinPE environment.
The HTTP header request and the actual download should use a consistent proxy configuration. Alternatively, the function could provide an option to use Invoke-WebRequest as the download method.
Screenshots
Not available.
Desktop (please complete the following information):
- OS: Windows PE (WinPE), deployment phase
- Browser: Not applicable
- Version: OSD 26.10.16.1
- WinPE build: Not provided
- PowerShell version: Not provided
Smartphone (please complete the following information):
Not applicable.
Additional context
Affected function:
Save-WebFile.ps1, OSD 26.10.16.1
The function selects the WebClient branch when DefaultWebProxy.Address is populated, when -WebClient is specified, or when curl.exe is unavailable. Otherwise, it uses the curl branch.
The exact reason why the proxy configuration is usable by Invoke-WebRequest but not by the curl download still needs investigation.
This issue concerns the download implementation in Save-WebFile, independently of the direct TCP precheck in Test-WebConnection.
- Lingua principale
- PowerShell
- Stelle
- 251
- Fork
- 102
- Merge medio
- 2m
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OSDeploy/OSD
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
Tutte le issue di OSDeploy/OSD
Issue simili
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
digitalbazaar/forge#1170 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getgrav/grav-plugin-form#664 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
FinanceFlash/unvibecode#595 ·
I maintainer di solito rispondono entro 1 giorno