diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-17 15:30:13 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-17 15:30:13 +0100 |
commit | 1285b780860fe782efe845f364e590a8e47bb564 (patch) | |
tree | 420b1301315cba0c6afee0be7a77f4171254b3f8 /core/js/files | |
parent | 38f4407761ea2d5cb2562518e207a43622f40b30 (diff) | |
parent | 064dcc079d8dba1754cf80fff66941f31d439002 (diff) | |
download | nextcloud-server-1285b780860fe782efe845f364e590a8e47bb564.tar.gz nextcloud-server-1285b780860fe782efe845f364e590a8e47bb564.zip |
Merge pull request #21200 from owncloud/files-authorizationheader
Use Authorization headers for public webdav in web UI
Diffstat (limited to 'core/js/files')
-rw-r--r-- | core/js/files/client.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/js/files/client.js b/core/js/files/client.js index 8854ee0c809..3d31f974ff8 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -35,27 +35,25 @@ if (options.useHTTPS) { url = 'https://'; } - var credentials = ''; - if (options.userName) { - credentials += encodeURIComponent(options.userName); - } - if (options.password) { - credentials += ':' + encodeURIComponent(options.password); - } - if (credentials.length > 0) { - url += credentials + '@'; - } url += options.host + this._root; this._defaultHeaders = options.defaultHeaders || {'X-Requested-With': 'XMLHttpRequest'}; this._baseUrl = url; - this._client = new dav.Client({ + + var clientOptions = { baseUrl: this._baseUrl, xmlNamespaces: { 'DAV:': 'd', 'http://owncloud.org/ns': 'oc' } - }); + }; + if (options.userName) { + clientOptions.userName = options.userName; + } + if (options.password) { + clientOptions.password = options.password; + } + this._client = new dav.Client(clientOptions); this._client.xhrProvider = _.bind(this._xhrProvider, this); }; |