diff --git a/background.js b/background.js index 86e6345..1fa9aa3 100644 --- a/background.js +++ b/background.js @@ -85,7 +85,7 @@ async function fetchPlanningXml(origin, phpsessid, unixDate) { `&day_start_hour=8` + `&day_end_hour=19`; console.log("[bg] fetchPlanningXml →", url.substring(0, 140)); - const r = await fetch(url, { credentials: "include" }); + const r = await evFetch(url, origin); console.log("[bg] status =", r.status); if (!r.ok) { // v4.2 : classifier l'erreur HTTP pour que le viewer affiche le bon @@ -100,6 +100,32 @@ async function fetchPlanningXml(origin, phpsessid, unixDate) { return xml; } +/** + * v5.0.9 : wrapper autour de fetch() qui ajoute systématiquement les + * headers de sécurité attendus par EasyVista (Referer, Sec-Fetch-Site, + * X-Requested-With). Sans ces headers, EV renvoie soit un