Feature: WebDAV: add http-headers option
I have:
-
searched https://gitlab.com/duplicity/duplicity/-/issues for similar issues. If you find a similar issue and the issue is still open, add a comment to the existing issue instead of opening a new one. If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. -
searched https://bugs.launchpad.net/duplicity for similar issues. If you find a similar issue, open a new issue on here and include a link to the original issue in the body of your new one. -
N/A tested that this issue still occurs on the latest stable snap (install instructions: https://snapcraft.io/duplicity), please include the snap version ( snap info duplicity | grep installed) output:installed: x.xx.xx (xx) -
N/A ideally, tested that this issue still occurs on the latest edge snap, if you can test without risking your data. Please include the snap version output: installed: x.xx.xx (xx)
Summary
I would like to request a cmd option to add values to the HTTP headers which are added on the WebDAV backend.
Description
That option would be equivalent to rclone’s --http-headers/--webdav-headers options (both doing the same but the first ist for the rclone HTTP backend, and the second for the WebDAV backend).
They are described as following:
Set HTTP headers for all transactions
Use this to set additional HTTP headers for all transactions
The input format is comma separated list of key,value pairs. Standard CSV encoding may be used.
For example to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.
You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.
Config: headers
Env Var: RCLONE_WEBDAV_HEADERS
Type: CommaSepList
Default:
For duplicity this would mean adding the values from the command line to the self.headers dictionary of WebDAVBackend
Example
That is useful, for example to set additional cookies, when the webdav sever does not have simple password authentication. For example, on Microsoft Sharepoint you need two cookies, which I would specify in rclone syntax as:
--webdav-headers "Cookie","rtFa=xxxxxxxxx","Cookie","FedAuth=yyyyyyyyyyy"
In duplicity this would mean setting the self.headers to:
self.headers = {u'Connection': u'keep-alive', 'Cookie': 'rtFa=xxxxxxxxx;FedAuth=yyyyyyyyyyy;'}
Beside authentication cookies this might also help on other special webdav servers.
References
This partly helps for the issue "Not working with OneDrive/SharePoint for businesses". A browser windows which automatically opens to receive cookies as described in the other issue, would be still nice, but an http header option as described in this issue is anyway helpful for scripting.