feed
feed copied to clipboard
Incorrect mime types, e.g. `image/jpg`, should be `image/jpeg`
Describe the bug
If given e.g. https://example.com/foo.jpg, formatEnclosure gives type="image/jpg" instead of the correct MIME type image/jpeg.
I haven't checked which clients actually care about this.
To Reproduce
This behavior is already visible in the tests: https://github.com/jpmonette/feed/blob/fd77835d23990670975092c15009c75432e258ac/src/tests/snapshots/rss2.spec.ts.snap#L34
Expected behavior
The generated feed should contain:
<enclosure ... type="image/jpeg"/>
Actual behavior
The generated feed contains:
<enclosure ... type="image/jpg"/>
Versions (please complete the following information):
- feed: 4.2.2
Additional context
The code at https://github.com/jpmonette/feed/blob/master/src/rss2.ts#L215-L223 returns the MIME type as image/[file_extension], which is correct for e.g. .png and .gif, but incorrect for e.g. .jpg and .svg.