Wrong filename from a custom url
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 13
- Forks
- 55
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 8
Description
Version:
Using version ~> 3.11 from chef_client_updater v3.8.4
Environment:
Windows 10
Scenario:
I'm using the cookbook attribute download_url_override as url: https://my.cloud/index.php/s/8yo7sEwDoJf32TN/download?path=chef-client&files=chef-client-latest-x64.msi - to download the chef-client.
Steps to Reproduce:
Use a download url like above.
Expected Result:
Save and download the file with the correct filename and complete the chef upgrade.
Actual Result:
The filename gets resolved to Filename: download?path=chef-client&files=chef-client-latest-x64.msi and cannot be downloaded because of illegal chars in the path:
Downloading chef from https://my.cloud/index.php/s/8yo7sEwDoJf32TN/download?path=chef-client&files=chef-client-latest-x64.msi to C:\Users\myuser\AppData\Local\Temp\download?path=chef-client&files=chef-client-latest-x64.msi.
Filename should be: chef-client-latest-x64.msi
PS:
$download_url = "https://my.cloud/index.php/s/8yo7sEwDoJf32TN/download?path=chef-client&files=chef-client-latest-x64.msi"
PS C:\opscode> ($download_url -split '/')[-1]
download?path=chef-client&files=chef-client-latest-x64.msi
Greetz
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/mixlib/install/generator/powershell/scripts/install_project.ps1.erb around line 94 and reproduce how the custom URL is split into a filename. Check the generated PowerShell installer with the reported URL; done means it saves the file as chef-client-latest-x64.msi and completes the Chef upgrade without illegal path characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100