diff --git a/backend/app/__init__.py b/backend/app/__init__.py index 20d1aeb..b2f2ccf 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -1,7 +1,7 @@ import os from pathlib import Path -from flask import Flask, redirect, send_from_directory +from flask import Flask, Response, redirect, send_from_directory from flask_cors import CORS from app.config import Config @@ -119,6 +119,24 @@ def create_app(config_class=Config): provide_automatic_options=False, ) + # Root DAV discovery: DAVx5 und einige andere Clients probieren zuerst + # PROPFIND/OPTIONS auf / (nur Hostname), bevor sie /.well-known nutzen. + # Wir reagieren hier auch mit DAV-Properties. + def _root_dav(): + if request.method == 'PROPFIND': + return dav_propfind(subpath='') + if request.method == 'OPTIONS': + return dav_options() + # GET/HEAD: SPA index handhabt das woanders - dieser View matcht nur DAV-Methoden + return Response('', 405) + + app.add_url_rule( + '/', view_func=_root_dav, + endpoint='_root_dav', + methods=['PROPFIND', 'OPTIONS'], + provide_automatic_options=False, + ) + # iCal export (public, no auth) @app.route('/ical/') def ical_export_route(token):