Skip to content

simplify HeadPathResponse try_from #2

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

Closed
wants to merge 2 commits into from

Conversation

cataggar
Copy link

For Azure#722

@@ -87,18 +87,17 @@ pub struct HeadPathResponse {
pub common_storage_response_headers: CommonStorageResponseHeaders,
pub etag: String,
pub last_modified: DateTime<Utc>,
pub properties: Option<Properties>,
Copy link
Owner

Choose a reason for hiding this comment

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

Hi Cameron, thanks for the response!

This needs to be an Option because Properties, in this context, is equal to x-ms-properties, and this header only gets returned when you don't specify an action. See the docs here. The previous implementation didn't consider it optional because GetProperties was the only implementation that existed. However, to support GetStatus (a derivation of GetProperties), it will need to be optional to support both. Hence the reason for changing this to an Option. Without this, the API response cannot be processed correctly. Take a look at the test I wrote for this function for context, specifically here and here. You will see that when the action is GetStatus, that x-ms-properties is not returned.

@rickrain rickrain closed this Apr 29, 2022
@cataggar cataggar deleted the get_status branch May 6, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants