mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-26 02:44:29 +00:00
Correctly check ETags.
This commit is contained in:
parent
f50d6d7170
commit
8811f48388
@ -63,11 +63,8 @@ if ( ! $dav_resource->Exists() && (isset($request->etag_if_match) && $request->e
|
||||
$request->PreconditionFailed(412,'if-match');
|
||||
}
|
||||
|
||||
if ( $dav_resource->Exists() && (
|
||||
(isset($request->etag_if_match) && $request->etag_if_match != '' && $request->etag_if_match != $dav_resource->unique_tag())
|
||||
|| (isset($request->etag_none_match) && $request->etag_none_match != '' && ($request->etag_none_match == $dav_resource->unique_tag() || $request->etag_none_match == '*') )
|
||||
) ) {
|
||||
if ( isset($request->etag_if_match) && $request->etag_if_match != $icalendar->dav_etag ) {
|
||||
if ( $dav_resource->Exists() ) {
|
||||
if ( isset($request->etag_if_match) && $request->etag_if_match != '' && $request->etag_if_match != $dav_resource->unique_tag() ) {
|
||||
/**
|
||||
* RFC2068, 14.25:
|
||||
* If none of the entity tags match, or if "*" is given and no current
|
||||
@ -76,7 +73,8 @@ if ( $dav_resource->Exists() && (
|
||||
*/
|
||||
$request->PreconditionFailed(412,'if-match', translate( 'Existing resource does not match "If-Match" header - not accepted.'));
|
||||
}
|
||||
else {
|
||||
else if ( isset($request->etag_none_match) && $request->etag_none_match != ''
|
||||
&& ($request->etag_none_match == $dav_resource->unique_tag() || $request->etag_none_match == '*') ) {
|
||||
/**
|
||||
* RFC2068, 14.26:
|
||||
* If any of the entity tags match the entity tag of the entity that
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user