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

Julian Reschke <julian.reschke@gmx.de> Thu, 12 March 2009 15:57 UTC

Return-Path: <julian.reschke@gmx.de>
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 0857A7841F3 for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:30 -0700 (PDT)
X-Virus-Scanned: by amavisd-new and clamav at osafoundation.org
X-Spam-Score: -2.823
X-Spam-Level:
X-Spam-Status: No, score=-2.823 tagged_above=-50 required=4 tests=[AWL=-0.223, BAYES_00=-2.599, SPF_PASS=-0.001]
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 kVQ6W64oOY2r for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:20 -0700 (PDT)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by leka.osafoundation.org (Postfix) with SMTP id D044779401C for <ietf-caldav@osafoundation.org>; Thu, 12 Mar 2009 08:57:19 -0700 (PDT)
Received: (qmail invoked by alias); 12 Mar 2009 15:57:17 -0000
Received: from mail.greenbytes.de (EHLO [192.168.1.106]) [217.91.35.233] by mail.gmx.net (mp008) with SMTP; 12 Mar 2009 16:57:17 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX1+/QrgKIAC/IiFXlSkAjrEJV1+qPy1oUtOvNjagah DmHbVm+er+buzZ
Message-ID: <49B930DA.1080206@gmx.de>
Date: Thu, 12 Mar 2009 16:57:14 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666
MIME-Version: 1.0
To: Gren Elliot <gren.elliot@scalix.com>
References: <49B92DF9.2000106@scalix.com>
In-Reply-To: <49B92DF9.2000106@scalix.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.48
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:30 -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.

Looks good so far.

> 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>

That's, stricly speaking, a malformed request, as the contents of 
DAV:href is syntactically invalid.

> 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;
> ...

It should be more than happy with it :-)

> So, my question is, what should go in <DAV:href>?  A well formed URL 
> with correct encoding or is it OK (or even more correct?) to translate 
> to the more visually friendly form?  Theoretically, in this particular 
> case, the response could follow whatever was used in the request but...

Nope.

RFC 4918 (WebDAV) requires the content to be a URI or a relative 
reference. You're not doing anybody a favor by working around client 
bugs; instead I'd recommend to contact the authors of the client and get 
it fixed.

BR, Julian