File upload miscategorizes *.jfif files as application/octet-stream
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
### Expected Behavior
When uploading files, either as the entire request body or as a file inside a Multipart Form, *.jfif files should have the content header `image/jpeg` [at least according to W3C](https://www.w3.org/Graphics/JPEG/).
### Actual Behavior
Insomnia selects the generic Content-Type `application/octet-stream` instead. For files as the only body of a request we can override this in the **Headers** section, but when sending files as part of a Multipart Form, the Content-Type for individual files seems to be completely inaccessible.
```
> Accept: */*
> Content-Length: 81608
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
| --X-INSOMNIA-BOUNDARY
| Content-Disposition: form-data; name=""; filename="sample1.jfif"
| Content-Type: application/octet-stream
| ����JFIF��C
```
### Reproduction Steps
1. Create a new POST request with a `Multipart Form`
2. Make one of the form parts a `File`
3. Select a *.jfif file to send
4. Send the request (you may need to expand the `Max timeline chunk size (KiB)` value to see the file's selected Content-Type
### Is there an existing issue for this?
- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.
### Additional Information
_No response_
### Insomnia Version
2023.5.8
### What operating system are you using?
Windows
### Operating System Version
Windows 10 Enterprise version 22H2
### Installation method
download from insomnia.rest
### Last Known Working Insomnia version
_No response_
Contributor guide
Research direction
Trace Insomnia's file-upload handling and extension-to-content-type mapping, starting with the multipart form path described in the reproduction steps. Reproduce the request with a .jfif file and verify that both a standalone upload and a multipart file part use image/jpeg instead of application/octet-stream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100