test: harden MIME normalization regression coverage (#32280) (thanks @Lucenx9)

This commit is contained in:
Peter Steinberger
2026-03-02 23:30:48 +00:00
parent 79e114a82f
commit de77a36579
2 changed files with 6 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ Docs: https://docs.openclaw.ai
- macOS/LaunchAgent security defaults: write `Umask=63` (octal `077`) into generated gateway launchd plists so post-update service reinstalls keep owner-only file permissions by default instead of falling back to system `022`. (#32022) Fixes #31905. Thanks @liuxiaopai-ai.
- Plugin SDK/runtime hardening: add package export verification in CI/release checks to catch missing runtime exports before publish-time regressions. (#28575) Thanks @Glucksberg.
- Media understanding/provider HTTP proxy routing: pass a proxy-aware fetch function from `HTTPS_PROXY`/`HTTP_PROXY` env vars into audio/video provider calls (with graceful malformed-proxy fallback) so transcription/video requests honor configured outbound proxies. (#27093) Thanks @mcaxtr.
- Media/MIME normalization: normalize parameterized/case-variant MIME strings in `kindFromMime` (for example `Audio/Ogg; codecs=opus`) so WhatsApp voice notes are classified as audio and routed through transcription correctly. (#32280) Thanks @Lucenx9.
- Media understanding/malformed attachment guards: harden attachment selection and decision summary formatting against non-array or malformed attachment payloads to prevent runtime crashes on invalid inbound metadata shapes. (#28024) Thanks @claw9267.
- Media understanding/parakeet CLI output parsing: read `parakeet-mlx` transcripts from `--output-dir/<media-basename>.txt` when txt output is requested (or default), with stdout fallback for non-txt formats. (#9177) Thanks @mac-110.
- Media understanding/audio transcription guard: skip tiny/empty audio files (<1024 bytes) before provider/CLI transcription to avoid noisy invalid-audio failures and preserve clean fallback behavior. (#8388) Thanks @Glucksberg.

View File

@@ -6,6 +6,7 @@ import {
extensionForMime,
imageMimeFromFormat,
isAudioFileName,
kindFromMime,
normalizeMimeType,
} from "./mime.js";
@@ -131,4 +132,8 @@ describe("mediaKindFromMime", () => {
] as const)("classifies $mime", ({ mime, expected }) => {
expect(mediaKindFromMime(mime)).toBe(expected);
});
it("normalizes MIME strings before kind classification", () => {
expect(kindFromMime(" Audio/Ogg; codecs=opus ")).toBe("audio");
});
});