feat(route/aeon): improve compatibility by enforcing the correct jpg enclosure type (#21470)
* Enforce enclosure type * remove trailing space
This commit is contained in:
@@ -95,6 +95,15 @@ export const getData = async (list) => {
|
||||
delete item.image;
|
||||
item.enclosure_url = data.audioUrl;
|
||||
item.enclosure_type = 'audio/mpeg';
|
||||
} else if (data.image?.url) {
|
||||
const imageUrl = data.image.url;
|
||||
const cleanImageUrl = imageUrl.split('?')[0].toLowerCase();
|
||||
|
||||
item.enclosure_url = imageUrl;
|
||||
if (cleanImageUrl.endsWith('.jpg') || cleanImageUrl.endsWith('.jpeg')) {
|
||||
item.enclosure_type = 'image/jpeg';
|
||||
}
|
||||
item.image = imageUrl;
|
||||
}
|
||||
|
||||
const capture = load(data.body, null, false);
|
||||
|
||||
Reference in New Issue
Block a user