Files
Anas Khan 10ab1a9789 fix: normalize Content-Type parameters in multimodal image processing (#1446)
SWEBenchMultimodalProblemStatement._download_and_convert_image compared the
full lowercased Content-Type header against VALID_IMAGE_MIME_TYPES. When a
server returns a valid image with media type parameters (for example
"Content-Type: image/png; charset=utf-8", which is legal per RFC 9110), the
string "image/png; charset=utf-8" is not in the allowed set, so the image is
logged as an unsupported MIME type and silently dropped from the problem
statement.

Strip the media type parameters (split on ";", strip, lowercase) before the
existing image/jpg -> image/jpeg normalization and the membership check, so the
bare media type is validated and used in the encoded data URI. Behavior for
unsupported types, size limits, empty images, and network failures is
unchanged.

Add a regression test covering a Content-Type header with a charset parameter.

Closes #1441

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-07 10:34:16 -04:00
..
2025-06-26 17:18:03 -04:00
2024-04-02 04:57:35 -04:00
2025-02-12 20:17:24 -08:00