PRECONDITIONS
PR1.3 firmware
DAViCal 1.0.2-1 for Linux. DAViCal is a groupware server that implements the CalDAV and CardDAV protocols.
STEPS LEADING TO THE PROBLEM:
Can't delete calendar events on the DAViCal server.
EXPECTED OUTCOME:
Delete any of the events I created on the server.
ACTUAL OUTCOME:
Deletion is not possible. In a conversation with a DAViCal developer, it was discovered that the N9 sends a CalDAV DELETE request that does not conform to the protocol specification. According to the developer, the N9's DELETE request is in a form not mentioned in the specification. The N9 sends its DELETE request with the content-type='application/xml' header and and no Content-Length. The specification calls for no body (i.e. no content-type) in a DELETE request. It does not cover an empty body.
FREQUENCY OF OCCURENCE:
Every time the calendar app synchronizes with the DAViCal server.
WORKAROUND:
The DAViCal developer created a patch for DAViCal. Because the patch is against the development branch of DAViCal and because the patch is trivial, I am pasting it here:
Code:
diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php
index c89fd96..85ef5d1 100644
--- a/inc/CalDAVRequest.php
+++ b/inc/CalDAVRequest.php
@@ -217,6 +217,7 @@ class CalDAVRequest
$_SERVER['REQUEST_METHOD'] = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];
}
$this->method = $_SERVER['REQUEST_METHOD'];
+ $this->content_length = (isset($_SERVER['CONTENT_LENGTH']) ? $_SERVER['CONTENT_LENGTH'] : null);
$this->content_type = (isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null);
if ( preg_match( '{^(\S+/\S+)\s*(;.*)?$}', $this->content_type, $matches ) ) {
$this->content_type = $matches[1];
@@ -555,7 +556,7 @@ EOSQL;
* If the content we are receiving is XML then we parse it here. RFC2518 says we
* should reasonably expect to see either text/xml or application/xml
*/
- if ( isset($this->content_type) && preg_match( '#(application|text)/xml#', $this->content_type ) ) {
+ if ( isset($this->content_length) && isset($this->content_type) && preg_match( '#(application|text)/xml#', $this->content_type ) ) {
if ( !isset($this->raw_post) || $this->raw_post == '' ) {
$this->XMLResponse( 400, new XMLElement( 'error', new XMLElement('missing-xml'), array( 'xmlns' => 'DAV:') ) );
}