feat(route/aeon): improve compatibility by enforcing the correct jpg enclosure type (#21470)

* Enforce enclosure type

* remove trailing space
This commit is contained in:
Enoch Ma
2026-03-23 09:58:57 +08:00
committed by GitHub
parent e86c679a92
commit 122a5343cb
+9
View File
@@ -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);