Skip to content
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 null/empty filename string when downloading package file #293

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

ryfu-msft
Copy link
Contributor

@ryfu-msft ryfu-msft commented Aug 3, 2022

Fixes #292

The changes in this PR fix an issue where the target filename used to create the package file is null. This can cause an UnauthorizedAccessException since an empty filename means that the File.OpenWrite is trying to write to a directory instead of a file. To resolve this, I use the filename from the requestUrl as the last option for the filename in case both the contentDispositionFile and urlFile names are both empty.

Verified manually with the related issue.

Microsoft Reviewers: Open in CodeFlow

@ryfu-msft ryfu-msft requested a review from a team as a code owner August 3, 2022 17:44
@ryfu-msft ryfu-msft requested review from yao-msft and removed request for a team August 3, 2022 17:44
@ghost ghost added the Issue-Bug label Aug 3, 2022
@ryfu-msft ryfu-msft merged commit 3ea6614 into microsoft:main Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installer URIs being a redirect cause a System.UnauthorizedAccessException
2 participants