From f94558832e927e13aadafc9d531a107d95fb6d05 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 13 Feb 2007 11:38:09 +1300 Subject: [PATCH] Ensure the Etag is provided for GET requests. --- inc/caldav-GET.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/caldav-GET.php b/inc/caldav-GET.php index f2183906..c0f45926 100644 --- a/inc/caldav-GET.php +++ b/inc/caldav-GET.php @@ -22,11 +22,12 @@ if ( $request->IsCollection() ) { $qry = new PgQuery( "SELECT caldav_data FROM caldav_data WHERE user_no = ? AND dav_name ~ ? ;", $request->user_no, $request->path.'[^/]+$'); } else { - $qry = new PgQuery( "SELECT caldav_data FROM caldav_data WHERE user_no = ? AND dav_name = ? ;", $request->user_no, $request->path); + $qry = new PgQuery( "SELECT caldav_data, dav_etag FROM caldav_data WHERE user_no = ? AND dav_name = ? ;", $request->user_no, $request->path); } dbg_error_log("get", "%s", $qry->querystring ); if ( $qry->Exec("GET") && $qry->rows == 1 ) { $event = $qry->Fetch(); + header( "Etag: \"$event->dav_etag\"" ); header( "Content-Length: ".strlen($event->caldav_data) ); $request->DoResponse( 200, ($request->method == "HEAD" ? "" : $event->caldav_data), "text/calendar" ); }