fix: PROPFIND/OPTIONS auf / (Root) akzeptieren - DAVx5 startet dort
DAVx5 macht beim Account-Setup zuerst PROPFIND auf / bevor es /.well-known/caldav probiert. Der Server antwortete mit 405 Method Not Allowed (weil / nur fuer SPA-GET registriert war), woraufhin DAVx5 den gesamten Server als "kein DAV" verwirft. Jetzt: PROPFIND und OPTIONS auf / werden an die DAV-Handler delegiert (gleiches Verhalten wie auf /dav/). GET/HEAD auf / laeuft unveraendert zur SPA. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3c762e1476
commit
39e68eee6a
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
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 flask_cors import CORS
|
||||||
|
|
||||||
from app.config import Config
|
from app.config import Config
|
||||||
|
|
@ -119,6 +119,24 @@ def create_app(config_class=Config):
|
||||||
provide_automatic_options=False,
|
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)
|
# iCal export (public, no auth)
|
||||||
@app.route('/ical/<token>')
|
@app.route('/ical/<token>')
|
||||||
def ical_export_route(token):
|
def ical_export_route(token):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue