fix: Correctly parse XML response from CORS proxy in RSS ticker

This commit is contained in:
2025-10-31 11:18:42 +01:00
parent f41bc910bc
commit 02b53b01a1

View File

@@ -73,13 +73,13 @@
fetch(url)
.then(response => {
console.log('Proxy response:', response);
if (response.ok) return response.json();
if (response.ok) return response.text();
throw new Error('Network response was not ok.');
})
.then(data => {
console.log('Raw data from proxy:', data);
.then(xmlText => {
console.log('Raw XML from proxy:', xmlText);
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(data.contents, "text/xml");
const xmlDoc = parser.parseFromString(xmlText, "text/xml");
console.log('Parsed XML Doc:', xmlDoc);
const items = xmlDoc.querySelectorAll("item");
let headlines = [];