Normalize image MIME before runtime presentation evidence binding - #829
Merged
chubes4 merged 1 commit intoAug 3, 2026
Merged
Conversation
The runtime presentation evidence probe filtered artifact files by MIME prefix (/^image\//), but fileType() falls back to application/octet-stream for extensions it does not map (gif, avif). A .gif typed as octet-stream was silently excluded from the browser asset hash map, so no bound observation was emitted for that image. Classify by extension instead, reusing isImagePath(), which already includes gif and now covers avif to match the downstream Blocks Engine normalizer's extension map. fileType() also gains gif/avif mappings for consistency. The probe now binds generic-MIME image files while still excluding unrelated binaries. Refs Automattic#821.
faisalahammad
force-pushed
the
fix/821-image-mime-runtime-evidence
branch
from
August 3, 2026 20:13
5fe0c4c to
3743aea
Compare
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.
Fixes #821.
Summary
isImagePath()instead of MIME prefix (/^image\//), so images with a generic MIME declaration (e.g..giftyped asapplication/octet-stream) are still bound into the browser asset hash map..gif→image/gifand.avif→image/aviftofileType()and add.aviftoisImagePath(), matching the extension map used downstream by blocks-engine'sArtifactNormalizer..gif/.avifinclusion and unrelated-binary exclusion intools/fixture-matrix.test.mjs.Test Plan
npm run test:fixture-matrix— 249/249 pass.npm test— 45/45 on changed scope. One remaining failure (smoke-url-batch-import.php) also fails on cleanmainand is unrelated.