An href with `%252F` (a UID holding `/`) comes back under the wrong URL
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #836 di @seriouslysean — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 20/100
Direzione di ricerca
Read _normalize_href, _post_multiget(), normalise_path() and _href_to_url() to trace how listed hrefs are decoded and quoted. Start with the %252F examples in the report and compare search, children, sync and multiget behavior. Done means listed hrefs for UIDs containing / resolve to the same object without losing path components; PR #836 is already open with a fix and tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Setup: iCloud, caldav 3.5.0 and 3.6.0. The events were saved by the iOS Calendar app from invitations (a dental booking site and an Epic MyChart portal).
iCloud names an object whose UID holds a / with the slash as %2F, percent-encoded on top, so the href has %252F (the name _quote_uid() mints too, #143). A GET on the listed href works. Values scrubbed, shapes unchanged:
| UID | href listed |
|---|---|
https://www.example.com/appointments/abc/?token=xyz |
/cal/home/https%3A%252F%252Fwww.example.com%252Fappointments%252Fabc%252F%3Ftoken%3Dxyz.ics |
A7CzVJ5v/[email protected] |
/cal/home/A7CzVJ5v%252FbTJo0Ebqoj2LQ%3D%3D%40mychart.example.org.ics |
_normalize_href decodes the href, and then it gets decoded a second time:
- In the #435 branch: the decoded first href holds a
:, so it's parsed as a URL and its path decoded again.search(),children()and sync return/cal/home/https://www.example.com/appointments/abc/. Any absolute href is decoded twice the same way. - In
_post_multiget(), whosenormalise_path()isquote(unquote(path)):multiget()returns the second object as/cal/home/A7CzVJ5v/bTJo0Ebqoj2LQ%3D%[email protected], which doesn't exist. Withurl.encode-at.identitydeclared,requote_path()does the same in_href_to_url()andchildren().
I'd expect the same for any object saved by this library with a / in its UID, since _quote_uid() mints the same names (not run against the test servers). The ha-test%2Fslash plus%20uid.ics object in #826 looks like the same shape. #783 and #826 are about UID lookups; this is about the hrefs a server lists.
#836 decides absolute vs path on the raw href (RFC 4918 section 8.3) and quotes the decoded href without decoding it again.
AI usage: Claude Code imported my calendar events, debugged the failure, paired with me on the fix and wrote this report. The reproduction was run with caldav 3.5.0; Claude also saw the first case live against iCloud with 3.6.0, and the code is the same in 3.6.0 and master.
While I used AI to do a lot of the work here, this was found while solving a real problem I encountered while importing my own calendar as read-only events for an on-prem agent. This package made it much easier to accomplish that. I've put up a PR to fix it (#836), and have patched it locally to ensure it works and is well tested.
- Lingua principale
- Python
- Stelle
- 412
- Fork
- 113
- Merge medio
- 10h 34m
- PR unite (30g)
- 75
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-caldav/caldav
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-caldav/caldav#792 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
python-caldav/caldav#788 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
python-caldav/caldav#687 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
python-caldav/caldav#829 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ical + caldavAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
python-caldav/caldav#825 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di python-caldav/caldav
Issue simili
-
infrastructure
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
NatLabRockies/H2Integrate#977 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
topoteretes/cognee#6470 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
area:docs priority:p2 type:docs wave:9
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
jejjohnson/radtrax#293 ·
I maintainer di solito rispondono entro 1 giorno
-
bug core plugins
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bunkerity/bunkerweb#4121 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno