From 678b00a9270d5be660762fd18a48d6fc936f78f3 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 28 Dec 2009 13:17:02 +1300 Subject: [PATCH] Return 406 Not Acceptable for invalid XML request. --- inc/caldav-REPORT.php | 4 ++-- testing/tests/regression-suite/220-Moz-REPORT.result | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/caldav-REPORT.php b/inc/caldav-REPORT.php index 9c2a647b..dc4152c0 100644 --- a/inc/caldav-REPORT.php +++ b/inc/caldav-REPORT.php @@ -27,12 +27,12 @@ if ( ! ($request->AllowedTo('read') || $request->AllowedTo('freebusy')) ) { } if ( !isset($request->xml_tags) ) { - $request->DoResponse( 403, translate("REPORT body contains no XML data!") ); + $request->DoResponse( 406, translate("REPORT body contains no XML data!") ); } $position = 0; $xmltree = BuildXMLTree( $request->xml_tags, $position); if ( !is_object($xmltree) ) { - $request->DoResponse( 403, translate("REPORT body is not valid XML data!") ); + $request->DoResponse( 406, translate("REPORT body is not valid XML data!") ); } require_once("iCalendar.php"); diff --git a/testing/tests/regression-suite/220-Moz-REPORT.result b/testing/tests/regression-suite/220-Moz-REPORT.result index 29996cd0..5a884b13 100644 --- a/testing/tests/regression-suite/220-Moz-REPORT.result +++ b/testing/tests/regression-suite/220-Moz-REPORT.result @@ -1,4 +1,4 @@ -HTTP/1.1 403 Forbidden +HTTP/1.1 406 Not Acceptable Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, access-control, calendar-access, calendar-schedule, extended-mkcol, calendar-proxy Content-Length: 34