Skip to content

feat(builders): detect file MIME types from extension instead of hardcoding#14

Merged
lsdrfrx merged 1 commit into
lsdrfrx:developfrom
SAY-5:feat/file-mime-detection
May 19, 2026
Merged

feat(builders): detect file MIME types from extension instead of hardcoding#14
lsdrfrx merged 1 commit into
lsdrfrx:developfrom
SAY-5:feat/file-mime-detection

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a TelegramEx.MimeType helper that resolves a file's content type from its extension, and uses it in the Photo, Video, Sticker, and Document builders instead of hardcoding the MIME type. Unknown extensions fall back to application/octet-stream.

Ready Checklist

  • Implementation: code works, types are specified, dialyzer passes
  • Documentation: functions have @doc, README updated if needed
  • Tests: tests added/updated, mix test passes locally
  • Example: usage example added to /example

Related Issues

Closes #10

@lsdrfrx lsdrfrx changed the base branch from main to develop May 19, 2026 06:10
@lsdrfrx

lsdrfrx commented May 19, 2026

Copy link
Copy Markdown
Owner

Thank you for your first PR, @SAY-5! Glad to see a new contributor!

@lsdrfrx lsdrfrx merged commit 0e275c6 into lsdrfrx:develop May 19, 2026
1 check passed
@lsdrfrx lsdrfrx added this to the v1.2.2 milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded MIME types in file upload builders lead to incorrect Content-Type headers

2 participants