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 blob_storage_request #862

Merged
merged 2 commits into from
Jun 28, 2022
Merged

fix blob_storage_request #862

merged 2 commits into from
Jun 28, 2022

Conversation

ctaggart
Copy link
Contributor

Fix #861. It is a bug from switching over to pipelines. When blob_storage_request was added in dd6b852, it skipped the existing prepare_request code that adds the necessary headers.

This now works:

cargo run -p azure_storage --example account00

@@ -509,8 +507,16 @@ impl StorageAccountClient {
}

/// Prepares' an `azure_core::Request`.
pub(crate) fn blob_storage_request(&self, http_method: azure_core::Method) -> Request {
Request::new(self.blob_storage_url().clone(), http_method)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, it was just creating a new Request.

&self,
http_method: azure_core::Method,
) -> azure_core::Result<Request> {
self.prepare_request(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix was to keep using the code that is in prepare_request.

@@ -59,6 +59,12 @@ pub enum ServiceType {
Table,
}

impl Default for ServiceType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is Blob the default storage type?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Url::parse(&format!("{}{}", queue_storage_url.as_str(), account)).unwrap();
let filesystem_url =
Url::parse(&format!("{}{}", filesystem_url.as_str(), account)).unwrap();
let blob_storage_url = Url::parse(&format!("{}{}", blob_storage_url, account)).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we probably shouldn't unwrap here as account is user supplied and could be poorly formed.

@rylev rylev merged commit 5b5e10e into Azure:main Jun 28, 2022
@ctaggart ctaggart deleted the fix-account-info branch August 2, 2022 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants