[CalendarServer-dev] Handling of URL encoding in server responses.
Cyrus Daboo
cdaboo at apple.com
Wed Aug 10 06:33:46 PDT 2016
Hi Peter,
--On August 10, 2016 at 9:41:29 AM +0200 Peter Mogensen <apm at one.com> wrote:
> However... (and this is the question) ... I'm a little in doubt about how
> to interpret RFC4918, section 8.3 wrt. which rules the server should obey
> wrt. the Request-URI when formulating the response.
>
> Is the server allowed to respond with <href>/%40</href> when the
> Request-URI was /@ ?
>
The @ character is being quoted:
cyrus:~ cyrusdaboo$ python
>>> import urllib
>>> urllib.quote("/me at you")
'/me%40you'
So you need to make sure you unquote the DAV:href value before doing your
comparison. Internally the server actually unquotes the request-URI as it
is processed, and then when building the DAV:href re-quotes. So even though
the request-URI used a "bare" @ symbol, it does get quoted in the output.
--
Cyrus Daboo
More information about the calendarserver-dev
mailing list