frankenstein icon indicating copy to clipboard operation
frankenstein copied to clipboard

refactor(client-ureq): remove mime_guess

Open EdJoPaTo opened this issue 10 months ago • 3 comments

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.

EdJoPaTo avatar Feb 21 '25 00:02 EdJoPaTo

Could you simulate big tests or something like that?

Just to be sure it is not breaking code.

Thank you in advance @EdJoPaTo

pxp9 avatar Feb 21 '25 00:02 pxp9

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

ayrat555 avatar Feb 21 '25 11:02 ayrat555

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 avatar Feb 21 '25 12:02 EdJoPaTo

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 avatar Mar 19 '25 14:03 EdJoPaTo