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

Potential fix for URL parsing bugs in BlobClient.from_blob_url() #12567

Closed
wants to merge 1 commit into from
Closed

Potential fix for URL parsing bugs in BlobClient.from_blob_url() #12567

wants to merge 1 commit into from

Conversation

chrisyeh96
Copy link
Contributor

This pull request proposes a fix for issue #12563

Consider a blob URL: 'https://lilablobssc.blob.core.windows.net/nacti-unzipped/part0/sub000/2010_Unit150_Ivan097_img0003.jpg'

Before this fix, from_blob_url() would incorrectly parse

  • blob_name: '2010_Unit150_Ivan097_img0003.jpg'
  • container_name: 'sub000'

This fix correctly parses the url as

  • blob_name: 'part0/sub000/2010_Unit150_Ivan097_img0003.jpg'
  • container_name: 'nacti-unzipped'

However, I believe my "fix" might be incomplete. In particular, it may not work for Azure Blob Storage accounts hosted on custom endpoints. As I was unable to find adequate documentation on how custom endpoints should be parsed, I did not consider this case. See the existing unit test here: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/tests/test_blob_client.py#L432-L439

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Jul 16, 2020
@xiafu-msft
Copy link
Contributor

Hi @chrisyeh96

Thanks so much for this pr! I opened another pr with CI passed, #12619 it should be able to fix your problem.
Would you mind if we close this pr?

@chrisyeh96
Copy link
Contributor Author

Thanks @xiafu-msft. Looking forward to your fix making it into a release!

@chrisyeh96 chrisyeh96 closed this Jul 21, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Mar 4, 2021
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants