Skip to content

Commit

Permalink
Check both Content-MD5 and x-ms-blob-content-md5
Browse files Browse the repository at this point in the history
  • Loading branch information
gaul committed Nov 10, 2024
1 parent 1dd0784 commit 14cb459
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Blob:
- Added support for filtering blob by tags.
- Fixed an issue where all blob APIs allowed metadata names which were not valid C# identifiers.
- Fixed always including metadata on blob list even when not requested
- Consider both Content-MD5 and x-ms-blob-content-md5 when creating a blob.

## 2024.08 Version 3.32.0

Expand Down
2 changes: 2 additions & 0 deletions src/blob/handlers/BlockBlobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class BlockBlobHandler
context.request!.getHeader("content-type") ||
"application/octet-stream";
const contentMD5 = context.request!.getHeader("content-md5")
|| context.request!.getHeader("x-ms-blob-content-md5")
? options.blobHTTPHeaders.blobContentMD5 ||
context.request!.getHeader("content-md5")
: undefined;
Expand Down Expand Up @@ -182,6 +183,7 @@ export default class BlockBlobHandler
// https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
// options.blobHTTPHeaders = options.blobHTTPHeaders || {};
const contentMD5 = context.request!.getHeader("content-md5")
|| context.request!.getHeader("x-ms-blob-content-md5")
? options.transactionalContentMD5 ||
context.request!.getHeader("content-md5")
: undefined;
Expand Down

0 comments on commit 14cb459

Please sign in to comment.