Relying solely on filename extensions when serving static assets or validating user uploads frequently causes production bugs. Content pipelines routinely save WebP or AVIF images with a legacy .jpg extension, and misconfigured S3 uploads often fall back to application/octet-stream or text/plain.
When you drop a local file named product-hero.jpg onto the inspector, the tool slices the opening bytes in memory and compares the binary signature against the extension mapping:
Filename: product-hero.jpg
Header Hex (0x00): 52 49 46 46 24 A1 01 00 57 45 42 50 56 50 38 58
Header ASCII: R I F F $ . . . W E B P V P 8 X
Instead of the JPEG Start-of-Image marker (FF D8 FF), bytes 0x00–0x03 contain RIFF and bytes 0x08–0x0B contain WEBP. The inspector flags the mismatch immediately and generates the accurate HTTP metadata:
{
"fileName": "product-hero.jpg",
"claimedExtension": ".jpg",
"claimedMimeType": "image/jpeg",
"detectedMagicHex": "52 49 46 46 ?? ?? ?? ?? 57 45 42 50",
"detectedMimeType": "image/webp",
"extensionMismatch": true,
"charsetRequired": false,
"compressible": false,
"recommendedHeaders": [
"Content-Type: image/webp",
"X-Content-Type-Options: nosniff"
]
}
For text-based assets without binary magic signatures—such as ES modules (.mjs or .js)—searching the directory outputs the exact RFC 9239 compliant header block ready for Nginx, Cloudflare Workers, or S3 metadata:
Content-Type: text/javascript; charset=utf-8
X-Content-Type-Options: nosniff