Open carstingaxion opened 5 months ago
It’s getting closer, but still not working. The blue notification says: Download cancelled
https://github.com/user-attachments/assets/618f3b67-6a33-45e5-8e21-99f7b92ee9f9
Seems to be more a problem of Firefox on iOS, in Safari it works.
https://github.com/user-attachments/assets/4bfdb585-6f6d-4234-ae7e-c3c989075756
See https://github.com/GatherPress/gatherpress/issues/606#issuecomment-2180683905
I guess this might be, because GatherPress puts the whole iCal rendering into the href attribute of the link, without sending explicit headers for an attachment.
I suggest introducing a new rewrite endpoint for the calendar links of an event. Having an explicit url for each of the add-to-calendar links should help solving the described bug. A positive side-effect is that, all interactions with those links become trackable within statistics.
The downloadable links should return the rendered iCal like currently, but with the missing headers added.
The real links to the Google and Yahoo calendars should be redirected early on
template_redirect
or some similar hook.