From 2032c0a7577803fbe2f711777629e16ea5564dda Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 11 Oct 2006 13:30:13 +1300 Subject: [PATCH] Parse If-Match and If-None-Match headers centrally. --- htdocs/caldav.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/caldav.php b/htdocs/caldav.php index 04697742..139ff1b5 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -72,6 +72,17 @@ xml_parser_set_option ( $xml_parser, XML_OPTION_SKIP_WHITE, 1 ); xml_parse_into_struct( $xml_parser, $raw_post, $xml_tags ); xml_parser_free($xml_parser); +unset($etag_if_match); +unset($etag_none_match); +if ( isset($_SERVER["HTTP_IF_NONE_MATCH"]) ) { + $etag_none_match = str_replace('"','',$_SERVER["HTTP_IF_NONE_MATCH"]); + if ( $etag_none_match == '' ) unset($etag_none_match); +} +if ( isset($_SERVER["HTTP_IF_MATCH"]) ) { + $etag_if_match = str_replace('"','',$_SERVER["HTTP_IF_MATCH"]); + if ( $etag_if_match == '' ) unset($etag_if_match); +} + /** * We put the code for each type of request into a separate include file @@ -93,5 +104,6 @@ switch ( $_SERVER['REQUEST_METHOD'] ) { dbg_error_log( "caldav", "RAW: %s", str_replace("\n", "",str_replace("\r", "", $raw_post)) ); } +exit(0); ?> \ No newline at end of file