[bug]: Using a file as request body in combination of a custom Content-Type freezes hoppscotch desktop app
wavedeck opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
I want to send an image file to an api that wants the mime-type of the file as the Content-Type header and the content of the file as a binary body. The only way i've been able to do this in hoppscotch was selecting "text/plain" as the Content-Type in the "Other" category and then selecting the file on the top right.
Hoppscotch's UI freezes for a while and doesn't respond to anything and recovers itself once it loaded and displays the binary content in the raw body input field. My test for a 300kb png file took about 12-15 seconds until hoppscotch recovers.
Another test using multipart/formdata and using the file select resulted in no freeze, so this only really happens in the case where you need a custom Content-Type and upload a file as a body.
Steps to reproduce
- Set the Content-Type to text/plain in the other category
- Upload a (small) image file to the raw body of the request
- Notice how hoppscotch freezes for a while and then displays the binary content inside the request body input field (similar how opening an image in notepad.exe or textedit.app would look like
Environment
Production
Version
Local