Set user agent when requesting iCal
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m5s
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m5s
This commit is contained in:
parent
7192f527e9
commit
922a8d24dd
@ -44,7 +44,13 @@ async function loadCalendar(): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const icalContents = await (await fetch(icalAddr)).text();
|
console.log("Refreshing iCal from Google Calendar")
|
||||||
|
|
||||||
|
// For some reason Google Calendar is sending different content based on who is requesting it.
|
||||||
|
const headers = new Headers();
|
||||||
|
headers.set('User-Agent', 'curl/7.54.1');
|
||||||
|
|
||||||
|
const icalContents = await (await fetch(icalAddr, { headers })).text();
|
||||||
const events = ical.parseICS(icalContents);
|
const events = ical.parseICS(icalContents);
|
||||||
const thisMonth = dayjs().startOf('month');
|
const thisMonth = dayjs().startOf('month');
|
||||||
const yesterday = dayjs().startOf('day').subtract(1, 'day');
|
const yesterday = dayjs().startOf('day').subtract(1, 'day');
|
||||||
|
Loading…
Reference in New Issue
Block a user