fix(backup): send required public DAV upload marker
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a1029d-2c93-7500-a0e0-e3e089668b29
This commit is contained in:
codex 2026-10-03 21:20:21 +02:00
parent 33ff82210e
commit 50da37cf50
7 changed files with 65 additions and 1 deletions

View file

@ -40,6 +40,9 @@ class NoRedirect(urllib.request.HTTPRedirectHandler):
def request(url, method='GET', body=None, auth=None, headers=None):
require(url.startswith(HOST + '/'), 'unapproved_provider_origin')
headers = dict(headers or {})
# Public DAV rejects non-GET requests without AJAX marker when federation is disabled.
if url.startswith(HOST + '/public.php/dav/') and method != 'GET':
headers['X-Requested-With'] = 'XMLHttpRequest'
if auth:
headers['Authorization'] = 'Basic ' + base64.b64encode((auth[0] + ':' + auth[1]).encode()).decode()
req = urllib.request.Request(url, data=body, method=method, headers=headers)