[buteo-sync-plugin-caldav] Avoid '/' character in URLs coming from lo… #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…cal UIDs.
When an incidence is imported, its UID can be anything. If it contains '/' characters, pushing this event to an URL created from the UID will fail. Simply replace '/' with '-' when forging an URL for a locally added
incidence.
@pvuorela , I found another faulty corner case. I imported a event with an UID like
11/07/2023 08:30:00damien.caliste@cea.frEvènement : entretiens vélos personnels0,70554750,533424
(I received it as a meeting appointment from my work).I checked the RFC5545, and it seems that UID can contain '/' characters. Of course pushing such an event to the server at a URL forged from the UID, like/caldav/Y2FsOi8vMC80NQ/11/07/2023...
failed. As mentioned in the comment, I first tried to percent encode the UID, which work when sending the event to the server. But the multiget request (to get the etag) to the percent encoded URL returned a 404 error, because it decoded the URL server-side and tried to look for something at/caldav/Y2FsOi8vMC80NQ/11/07/2023...
. I'm not sure if it's an issue from the server or if we should double encode the URL in the multiget request. But the simpler solution was to just replace any '/' with something less harmfull.