Skip to content

refactor(client-ureq): remove mime_guess#261

Closed
EdJoPaTo wants to merge 2 commits intomasterfrom
edjopato/remove-mime-guess
Closed

refactor(client-ureq): remove mime_guess#261
EdJoPaTo wants to merge 2 commits intomasterfrom
edjopato/remove-mime-guess

Conversation

@EdJoPaTo
Copy link
Copy Markdown
Collaborator

While tinkering on #260 I noticed that mime_guess doesn't seem to be required. Everything I tested worked fine without. But I only tested with quite small files and the officially hosted bot API servers, not a self-hosted one.

reqwest also depends on mime_guess, so I'm not sure whether its used internally for the client-reqwest multipart stuff there. It's also possible to specify a mime with reqwest multipart, but it's not done there. Either it's not required at all or reqwest does the assumption internally which doesn't seem the case to be currently, but I haven't looked far.

@ayrat555 @pxp9 do you have any thoughts on this? There should probably more testing before something like this is changed.

@pxp9
Copy link
Copy Markdown
Collaborator

pxp9 commented Feb 21, 2025

Could you simulate big tests or something like that?

Just to be sure it is not breaking code.

Thank you in advance @EdJoPaTo

@ayrat555
Copy link
Copy Markdown
Owner

for me it's ok. not sure if telegram uses provided mime type. maybe we can try uploading a couple of files and check how they are displayed in telegram

@EdJoPaTo
Copy link
Copy Markdown
Collaborator Author

as self-hosted bot API servers seem to have different handling of files in more places, I think its a good idea to do these tests against them too.

@EdJoPaTo
Copy link
Copy Markdown
Collaborator Author

I think I'll just leave it as is and drop this PR. #260 simplifies this mime_guess logic and it's not a big dependency.

@EdJoPaTo EdJoPaTo closed this Mar 19, 2025
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.

3 participants