Skip to content

Commit a511513

Browse files
committed
Fix Azure storage date header for SAS authentication
Only add date header for shared key authentication where it's required for signature generation. SAS tokens are self-contained and don't need the date header, which was causing test failures.
1 parent 7e1ec6c commit a511513

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/storage/azure/storage.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ storageAzureAuth(
131131
{
132132
// Set required headers
133133
httpHeaderPut(httpHeader, HTTP_HEADER_HOST_STR, this->host);
134-
httpHeaderPut(httpHeader, HTTP_HEADER_DATE_STR, dateTime);
135134
httpHeaderPut(httpHeader, AZURE_HEADER_VERSION_STR, AZURE_HEADER_VERSION_VALUE_STR);
136135

137136
// Shared key authentication
138137
if (this->keyType == storageAzureKeyTypeShared)
139138
{
139+
// Date header is required for shared key authentication (used in signature generation)
140+
httpHeaderPut(httpHeader, HTTP_HEADER_DATE_STR, dateTime);
141+
140142
ASSERT(this->sharedKey != NULL);
141143

142144
// Generate canonical headers

0 commit comments

Comments
 (0)