Bug: iCloud Public Calendar rejected even though URL returns valid VCALENDAR via GET #310
BugSecond Brain v2.1+ rejects an Apple iCloud Public Calendar URL with:
The calendar was shared exactly as documented in the Second Brain README: iCloud → Share Calendar → Public Calendar The resulting feed has been independently tested and is a valid iCalendar feed. Environment
The actual calendar token is intentionally redacted because the public-calendar URL provides read access to the calendar. Steps to reproduce
Second Brain rejects it with the error above. Changing Diagnostic resultsHEAD request failsConverting the URL to HTTPS and issuing HEAD: curl -L -I 'https://pXX-caldav.icloud.com/published/2/[REDACTED]'returns: Using HTTP first produces: and following that redirect ultimately gives the same GET succeedsA normal GET against the exact same calendar succeeds: curl -L -s 'https://pXX-caldav.icloud.com/published/2/[REDACTED]' | head -10Output: So the iCloud endpoint is accessible and returns valid iCalendar data when fetched with GET. Suspected causeThe calendar validator may be doing a HEAD request before GET and rejecting the calendar when Apple's published-calendar endpoint returns Other possibilities:
The HEAD behavior seems particularly suspicious because HEAD fails while GET against the identical resource succeeds and returns Suggested fixFor iCloud calendar URLs:
This would support Apple's published-calendar URLs in the manner documented by Second Brain itself. Happy to run additional sanitized diagnostics if useful. |
Replies: 2 comments
|
Thank you for this — the sanitized diagnostics were genuinely useful, and a report this careful made it quick to track down. It turned out not to be HEAD. There is no HEAD request anywhere in the calendar path; it was always a plain GET, and both Fixed in #311, now merged. Both quirks are sanitized before parsing, redirects are followed explicitly, and a This will go out with 2.3.2. I'll leave this open until that release lands, then close it out. |
|
1.3.2 is out with this fix: https://github.com/rahilp/second-brain-cloudflare/releases/tag/installer-v1.3.2 Update the desktop app, or redeploy the Worker if you self-host ( Thanks again for the report — the sanitized diagnostics saved a lot of guesswork. Closing this out, but reopen if it still gives you trouble. |
Thank you for this — the sanitized diagnostics were genuinely useful, and a report this careful made it quick to track down.
It turned out not to be HEAD. There is no HEAD request anywhere in the calendar path; it was always a plain GET, and both
webcal://normalization and the missing.icsextension were already handled. The tell is the error you quoted: that message is only reachable after a successful fetch with a body in hand, so iCloud had already answered you and it was our ICS parsing that gave up. Apple's published feeds carry anX-APPLE-STRUCTURED-LOCATIONline whose continuation isn't folded the way the parser expects, and some feeds also lead with a UTF-8 BOM. Either one throws.…