testsuite: support /principals/users/ and similar special URLs

This commit is contained in:
Florian Schlichting 2017-10-04 23:19:00 +02:00
parent 8d1a4dba0f
commit 5dc4aed87c
3 changed files with 16 additions and 8 deletions

View File

@ -30,6 +30,9 @@ Alias /davical /usr/share/davical/htdocs
RewriteRule ^/\.well-known/(.*)$ /davical/caldav.php/.well-known/$1 [NC,L]
# Optionally: redirect /principals/users/ as well
RewriteRule ^/principals/users/(.*)$ /davical/caldav.php/$1 [NC,L]
RewriteRule ^/principals/resources/(.*)$ /davical/caldav.php/$1 [NC,L]
RewriteRule ^/calendars/__uids__/(.*)$ /davical/caldav.php/$1 [NC,L]
RewriteRule ^/addressbooks/__uids__/(.*)$ /davical/caldav.php/$1 [NC,L]
# Optionally: Put DAViCal in the root
# NOTE: this will break other applications that rely on mod_rewrite!
@ -43,5 +46,5 @@ Alias /davical /usr/share/davical/htdocs
#RewriteCond %{REQUEST_URI} !\.(php|html|css|js|png|gif|jpg|ico)
#
# Everything else gets rewritten to /caldav.php/...
#RewriteRule ^(.*)$ /caldav.php$1 [NC,L]
#RewriteRule ^(.*)$ /davical/caldav.php$1 [NC,L]
</IfModule>

View File

@ -39,6 +39,11 @@ to /etc/hosts and a VirtualHost to Apache with
RewriteEngine On
# Redirect /.well-known URLs
RewriteRule ^/\.well-known/(.*)$ /caldav.php/.well-known/$1 [NC,L]
# and other special URLs
RewriteRule ^/principals/users/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/principals/resources/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/calendars/__uids__/(.*)$ /caldav.php/$1 [NC,L]
RewriteRule ^/addressbooks/__uids__/(.*)$ /caldav.php/$1 [NC,L]
# let caldav.php handle "anything else"
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !\.(php|css|png|gif|js|jpg|ico)

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "9c0097968135b1bb539cee7121158c9c"
Content-Length: 995
ETag: "e9fc2a56ba9302e5bd7406ee47a4d69a"
Content-Length: 1025
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -13,20 +13,20 @@ Content-Type: text/xml; charset="utf-8"
<propstat>
<prop>
<C:calendar-home-set>
<href>/caldav.php/user1/</href>
<href>/principals/users/user1/</href>
</C:calendar-home-set>
<C:calendar-user-address-set>
<href>mailto:user1@example.net</href>
<href>/caldav.php/user1/</href>
<href>/principals/users/user1/</href>
</C:calendar-user-address-set>
<C:schedule-inbox-URL>
<href>/caldav.php/user1/.in/</href>
<href>/principals/users/user1/.in/</href>
</C:schedule-inbox-URL>
<C:schedule-outbox-URL>
<href>/caldav.php/user1/.out/</href>
<href>/principals/users/user1/.out/</href>
</C:schedule-outbox-URL>
<A:dropbox-home-URL>
<href>/caldav.php/user1/.drop/</href>
<href>/principals/users/user1/.drop/</href>
</A:dropbox-home-URL>
<displayname>User 1</displayname>
</prop>