OSDeploy / OSD

OSD Shared Functions
MIT License
144 stars 59 forks source link

ImageFileUrl error with URL query parameters #16

Closed iainbrighton closed 2 years ago

iainbrighton commented 2 years ago

Describe the bug When downloading an image from a URL using the ImageFileUrl parameter, if the URL contains a query string i.e. an Azure file with a SAS token, the WebFile.ps1 script throws an error. In short, the query parameters are not removed and end up being included in the local destination filename - which is invalid.

To Reproduce Run Start-OSDCloud -ImageFileUrl "<Any_URL_with_query_parameters>"

Expected behavior I would expect the URL query parameters to be removed/not included in the local file

I have fixed the problem in a fork and I am happy to submit a pull request if the code meets your requirements/expectations.

Thanks, Iain

OSDeploy commented 2 years ago

I’ll check this out and get back to you. Thanks!

On Thu, Dec 16, 2021 at 9:29 AM Iain Brighton @.***> wrote:

Describe the bug When downloading an image from a URL using the ImageFileUrl parameter, if the URL contains a query string i.e. an Azure file with a SAS token, the WebFile.ps1 script throws an error. In short, the query parameters are not removed and end up being included in the local destination filename - which is invalid.

To Reproduce Run Start-OSDCloud -ImageFileUrl ""

Expected behavior I would expect the URL query parameters to be removed/not included in the local file

I have fixed the problem in a fork https://github.com/VirtualEngine/OSD/commit/e67af0e6cb6e3beaa0d826d12f530684af3a9e8b and I am happy to submit a pull request if the code meets your requirements/expectations.

Thanks, Iain

— Reply to this email directly, view it on GitHub https://github.com/OSDeploy/OSD/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADC6QFSLYUNLZ46FH4IOTDTURIAXPANCNFSM5KGTK7FQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

OSDeploy commented 2 years ago

This looks and worked great. I added this to the code for the next release (days) and appreciate the effort. David