Azure / azure-sdk-for-rust

This repository is for active development of the *unofficial* Azure SDK for Rust. This repository is *not* supported by the Azure SDK team.
MIT License
680 stars 232 forks source link

Support `If-None-Match` header #1645

Closed bonsairobo closed 2 months ago

bonsairobo commented 2 months ago

I think we need this header to correctly raise a conflict when there is a race to create a blob.

The documentation: https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations#Subheading1

If-None-Match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. For versions 2011-08-18 and newer, the ETag can be specified in quotes.

Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

bonsairobo commented 2 months ago

Oops! I just realized that the IfMatchCondition supports both If-Match and If-None-Match at the same time. Disregard.