-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: YamlCreate using invalid filename for downloading #29454
Fix: YamlCreate using invalid filename for downloading #29454
Conversation
I'm not familiar with what this code is actually doing? Would you be able to help me understand how it works? |
I updated the code so that it will not invoke web requests twice. |
Why not just name the file I'm fine with this, but I'm just afraid if someone didn't configure their web server correctly you could still get a yucky name. |
For the purposes of the script, do we even need the file extension other than for determining the installer type? |
We shouldn't. |
I think 🤔 it can be closed (sorry if I am wrong) since a fix will be implemented in v2.0.0 soon. |
winget validate --manifest <path>
?winget install --manifest <path>
?Note:
<path>
is the name of the directory containing the manifest you're submitting.The script obtains the file name by slicing InstallerUrl variable and appends it to the destinaiton path, but sometimes the url doesn't contain a valid filename, which may cause errors.
For example, if InstallerUrl is set to "https://pinyin.thunisoft.com/webapi/v1/setup/downloadSetup?setupid=21f0e88683894ebcb440759c5aa25c47&filename=HuayuPY-V7.2.0.213.exe", the script will use "downloadSetup?setupid=21f0e88683894ebcb440759c5aa25c47&filename=HuayuPY-V7.2.0.213.exe" as file name, which contains an invalid file name character "?".
Many servers tell the client the real file name by adding a "ContentDisposition" field to the response header. If existed, the modified code will use it instead.
Microsoft Reviewers: Open in CodeFlow