FIX Infer Azure Blob MIME types from file extensions - #2315
Open
romanlutz wants to merge 2 commits into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b06b3a6a-deb0-476e-a47e-d0f384760420
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b06b3a6a-deb0-476e-a47e-d0f384760420
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Azure Blob payloads written through
AzureBlobStorageIOcurrently receive the configured defaulttext/plainmetadata even when their filenames identify images, audio, video, or documents. This can cause downstream consumers to handle otherwise-correct bytes as text.This change adds a private, deterministic extension-to-MIME mapping inside
AzureBlobStorageIO.write_file_async, retaining the configured default for unknown or extensionless paths. It deliberately preserves the original two-argumentStorageIO.write_file_asynccontract so existing third-party storage implementations remain compatible, and leavesAzureBlobStorageTarget's separate text-only content-type API unchanged.Serializer filename handling now replaces an existing suffix instead of appending a duplicate one. Formatted PCM audio is always written as RIFF/WAVE with a
.wavfilename, allowing Azure metadata inference to setaudio/wav, including when callers provide a filename with another extension.This is a fresh replacement for the useful intent of closed PR #2233 without reusing its branch or broadening the public storage API.
Tests and Documentation
audio/wavmetadata coverage.StorageIOcompatibility regressions.86 passed.