Whoops: we weren't sending an ETag on PUT for non-Calendar resources.

This commit is contained in:
Andrew McMillan 2010-09-12 13:13:27 +12:00
parent a96fc08016
commit a0ca0e27c7
12 changed files with 16 additions and 2 deletions

View File

@ -65,10 +65,11 @@ $collection_id = $container->GetProperty('collection_id');
$qry = new AwlQuery();
$qry->Begin();
$etag = md5($request->raw_post);
$params = array(
':user_no' => $dest->GetProperty('user_no'),
':dav_name' => $dest->bound_from(),
':etag' => md5($request->raw_post),
':etag' => $etag,
':dav_data' => $request->raw_post,
':session_user' => $session->user_no
);
@ -90,5 +91,6 @@ $qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)"
$qry = new AwlQuery('COMMIT');
if ( !$qry->Exec('move') ) rollback(500);
header('ETag: "'. $etag . '"' );
if ( $response_code == 200 ) $response_code = 204;
$request->DoResponse( $response_code );

View File

@ -57,10 +57,11 @@ $collection_id = $container->GetProperty('collection_id');
$qry = new AwlQuery();
$qry->Begin();
$etag = md5($request->raw_post);
$params = array(
':user_no' => $dest->GetProperty('user_no'),
':dav_name' => $dest->bound_from(),
':etag' => md5($request->raw_post),
':etag' => $etag,
':dav_data' => $request->raw_post,
':session_user' => $session->user_no
);
@ -92,5 +93,6 @@ $qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)"
if ( !$qry->QDo('COMMIT') ) rollback(500);
header('ETag: "'. $etag . '"' );
if ( $response_code == 200 ) $response_code = 204;
$request->DoResponse( $response_code );

View File

@ -4,6 +4,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "24bae2a7f81c0a79413a656c06d8326b"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "fada70a725708bce8521efb87acfa629"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "3419498c6e5eae71dc1704f1787faf1c"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -4,6 +4,7 @@ HTTP/1.1 204 No Content
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "0ea4d7759e103090c6494505b5da0f11"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "d43780719361367f2d690f1f966e3da1"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -4,6 +4,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "e67537e9d473e93911eccd6e63e9ac3a"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -4,6 +4,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "f6ae02ec1b5612fe4737092734d062c7"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -4,6 +4,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "db3e92c0ae37268c647949367e2030cc"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "feaa1a28c9942fc56403e2f97f75171b"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"

View File

@ -2,6 +2,7 @@ HTTP/1.1 201 Created
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "5a32961b9938a7d6a354a757a8a1ea36"
Content-Length: 0
Content-Type: text/plain; charset="utf-8"