mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-11-02 09:59:36 +00:00
public.php: answer OPTIONS on ancestors of a ticketed collection
This commit is contained in:
parent
e990c2edcb
commit
64d976771e
@ -19,6 +19,18 @@ $dav = "1, 2, calendar-access";
|
||||
header( "DAV: $dav");
|
||||
require_once("CalDAVRequest.php");
|
||||
$request = new CalDAVRequest();
|
||||
|
||||
// A CalDAV client performing calendar discovery may send an OPTIONS request to
|
||||
// an ancestor of the ticketed collection (e.g. OPTIONS /user/?ticket=...) to
|
||||
// probe server capabilities. OPTIONS returns only capability headers, never
|
||||
// resource data, so answer it whenever a valid ticket is presented, even when
|
||||
// the ticket scope does not cover that ancestor. Data-bearing methods below
|
||||
// stay gated by the ticket path check, so no collection contents are exposed.
|
||||
if ( $request->method == 'OPTIONS'
|
||||
&& isset($request->ticket) && ! $request->ticket->expired ) {
|
||||
header('Allow: OPTIONS, GET, HEAD, PROPFIND, REPORT');
|
||||
$request->DoResponse( 200, '' );
|
||||
}
|
||||
if ( ! $request->IsPublic() &&
|
||||
(! isset($request->ticket)
|
||||
|| $request->ticket->expired
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user