Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Fix .jpg resolving to non-standard image/jpg instead of image/jpeg (#4333)
## Problem `composio.utils.mimetypes.guess()` maps `.jpg` to `"image/jpg"`: ```python ".jpe": "image/jpeg", ".jpeg": "image/jpeg", ".jpg": "image/jpg", # <- non-standard ``` `image/jpg` is not a registered IANA media type. It is inconsistent with: - its own sibling extensions `.jpe`, `.jpeg`, and `.jfif-bnl`, which all map to `image/jpeg` - Python's standard library: `mimetypes.guess_type("x.jpg")` returns `image/jpeg` - IANA, which registers `image/jpeg` `guess()` feeds the `Content-Type` used for presigned uploads (`_upload_to_presigned_url`), so `.jpg` files are uploaded and stored with a non-standard content type. ## Fix Map `.jpg` to `image/jpeg`. One line. The reverse `_MIME_TO_EXT` map keeps its `"image/jpg": "jpg"` entry on purpose: the SDK should still accept `image/jpg` when a server sends it in a `Content-Type` header (liberal in what it accepts, strict in what it produces). ## Tests Added coverage in `tests/test_mimetypes.py`: `.jpg`/`.jpeg` in the known-extensions table plus a dedicated test documenting that `.jpg` resolves to `image/jpeg`. Verified the new tests fail on the old value and pass after the fix; the full `test_mimetypes.py` (35 tests) passes.