fix(backup): send required public DAV upload marker
Assistant: codex Assistant-Model: gpt-6.1-sol Assistant-Session: 01a1029d-2c93-7500-a0e0-e3e089668b29
This commit is contained in:
parent
33ff82210e
commit
50da37cf50
7 changed files with 65 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue