Re: [ietf-caldav] <DAV:href> and invalid URL characters

Arnaud Quillaud <Arnaud.Quillaud@Sun.COM> Thu, 12 March 2009 15:57 UTC

Return-Path: <Arnaud.Quillaud@Sun.COM>
X-Original-To: ietf-caldav@osafoundation.org
Delivered-To: ietf-caldav@osafoundation.org
Received: from localhost (localhost [127.0.0.1]) by leka.osafoundation.org (Postfix) with ESMTP id C8A2A77D70E for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:14 -0700 (PDT)
X-Virus-Scanned: by amavisd-new and clamav at osafoundation.org
X-Spam-Score: -5.676
X-Spam-Level:
X-Spam-Status: No, score=-5.676 tagged_above=-50 required=4 tests=[AWL=0.923, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from leka.osafoundation.org ([127.0.0.1]) by localhost (leka.osafoundation.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XoeT+i1vWbuj for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:06 -0700 (PDT)
Received: from gmp-eb-inf-2.sun.com (gmp-eb-inf-2.sun.com [192.18.6.24]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by leka.osafoundation.org (Postfix) with ESMTP id 57BC57841F3 for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:04 -0700 (PDT)
Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe2.eu.sun.com [192.18.6.11]) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n2CFuo3e025838 for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 15:57:03 GMT
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009)) id <0KGE00F00GXDA500@fe-emea-09.sun.com> for ietf-caldav@osafoundation.org; Thu, 12 Mar 2009 15:56:50 +0000 (GMT)
Received: from [129.150.117.220] ([unknown] [129.150.117.220]) by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009)) with ESMTPSA id <0KGE00ANIHMOB360@fe-emea-09.sun.com>; Thu, 12 Mar 2009 15:56:49 +0000 (GMT)
Date: Thu, 12 Mar 2009 16:56:48 +0100
From: Arnaud Quillaud <Arnaud.Quillaud@Sun.COM>
In-reply-to: <49B92DF9.2000106@scalix.com>
Sender: Arnaud.Quillaud@Sun.COM
To: Gren Elliot <gren.elliot@scalix.com>
Message-id: <49B930C0.7050006@sun.com>
References: <49B92DF9.2000106@scalix.com>
User-Agent: Thunderbird 2.0.0.19 (X11/20090105)
Cc: CalDAV DevList <ietf-caldav@osafoundation.org>
Subject: Re: [ietf-caldav] <DAV:href> and invalid URL characters
X-BeenThere: ietf-caldav@osafoundation.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Discussions on Calendar Access protocol based on WebDAV <ietf-caldav.osafoundation.org>
List-Unsubscribe: <http://lists.osafoundation.org/mailman/listinfo/ietf-caldav>, <mailto:ietf-caldav-request@osafoundation.org?subject=unsubscribe>
List-Archive: <http://lists.osafoundation.org/pipermail/ietf-caldav>
List-Post: <mailto:ietf-caldav@osafoundation.org>
List-Help: <mailto:ietf-caldav-request@osafoundation.org?subject=help>
List-Subscribe: <http://lists.osafoundation.org/mailman/listinfo/ietf-caldav>, <mailto:ietf-caldav-request@osafoundation.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Mar 2009 15:57:14 -0000

Gren Elliot wrote:
> Hi,
>
> Seeking some thoughts or a pointer to a definitive answer, as I can't 
> see an immediate, definitive answer in the WebDAV spec.
>
> We sometimes find that a CalDAV client ends up choosing the final 
> element of the path name for a new calendar entry using a PUT similar to :
>
> PUT 
> /api/dav/Calendars/Users/Attendee.One@eg.test/Calendar/%7BCA-GREN-49B1-233%7D.ics 
> HTTP/1.1
>
> %7B happens to be the way you would encode "{" in a URL and %7D for "}", 
> these characters not being valid in a well formed URL.
>
> The same client then later asks for the same entry using :
> REPORT /api/dav/Calendars/Users/Attendee.One@eg.test/Calendar/ HTTP/1.1
> ...
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <x0:calendar-multiget xmlns:x0="urn:ietf:params:xml:ns:caldav" 
> xmlns:x1="DAV:">
> <x1:prop>
> <x1:getetag/>
> <x0:calendar-data/>
> </x1:prop>
> <x1:href>/api/dav/Calendars/Users/Attendee.One@eg.test/Calendar/{CA-GREN-49B1-233}.ics</x1:href>
> </x0:calendar-multiget>
>
> and is not happy when it gets the response :
>
> <D:multistatus xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
> <D:response>
> <D:href>/api/dav/Calendars/Users/Attendee.One@eg.test/Calendar/%7BCA-GREN-49B1-233%7D.ics</D:href>
> <D:propstat>
> <D:prop>
> <D:getetag>8</D:getetag>
> <C:calendar-data>BEGIN:VCALENDAR&#13;
> CALSCALE:GREGORIAN&#13;
> ...
>
> So, my question is, what should go in <DAV:href>?  A well formed URL 
>   
Yes, it should be encoded. See 
http://tools.ietf.org/html/rfc4918#section-8.3.1 (or read the full 
rfc3986 but that is probably more painful).

> with correct encoding or is it OK (or even more correct?) to translate 
> to the more visually friendly form?  Theoretically, in this particular 
>   
It is not OK, especially if both sides start to reencode/decode stuff, 
assuming that the other side was using/not using encoding (e.g. your %7B 
might become %407B after a first round trip, then %40407B,...).
> case, the response could follow whatever was used in the request but...
>
> Regards,
> Gren.
>
>