Open tuomassalo opened 2 years ago
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.
https://example.com/foo.jpg
formatEnclosure
type="image/jpg"
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):
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.
image/[file_extension]
.png
.gif
.jpg
.svg
Describe the bug
If given e.g.
https://example.com/foo.jpg
,formatEnclosure
givestype="image/jpg"
instead of the correct MIME typeimage/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:
Actual behavior
The generated feed contains:
Versions (please complete the following information):
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
.