From 273fb758247fd8f3c6a54fec1f773d2a0cd5ff20 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 16 Feb 2016 17:28:24 +0100 Subject: [PATCH 1/2] Update davclient library for propfind headers --- core/vendor/davclient.js/lib/client.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/vendor/davclient.js/lib/client.js b/core/vendor/davclient.js/lib/client.js index d3d0a7062c0..deb0e1ee964 100644 --- a/core/vendor/davclient.js/lib/client.js +++ b/core/vendor/davclient.js/lib/client.js @@ -40,18 +40,19 @@ dav.Client.prototype = { * * @param {string} url Url to do the propfind request on * @param {Array} properties List of properties to retrieve. + * @param {Object} [headers] headers * @return {Promise} */ - propFind : function(url, properties, depth) { + propFind : function(url, properties, depth, headers) { if(typeof depth == "undefined") { depth = 0; } - var headers = { - Depth : depth, - 'Content-Type' : 'application/xml; charset=utf-8' - }; + headers = headers || {}; + + headers['Depth'] = depth; + headers['Content-Type'] = 'application/xml; charset=utf-8'; var body = '\n' + @@ -103,6 +104,7 @@ dav.Client.prototype = { * * @param {string} url Url to do the proppatch request on * @param {Array} properties List of properties to store. + * @param {Object} [headers] headers * @return {Promise} */ propPatch : function(url, properties, headers) { From 5575443be96e2a8b9b966fad6e3191f2c0d96740 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 16 Feb 2016 17:28:35 +0100 Subject: [PATCH 2/2] Fix redundant headers in files dav client The defaultHeaders are already injected with the xhrProvider, so no need to pass them again a second time. --- core/js/files/client.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/core/js/files/client.js b/core/js/files/client.js index 55a8e2c485a..627630e8b03 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -394,7 +394,6 @@ properties = options.properties; } - // TODO: headers this._client.propFind( this._buildUrl(path), properties, @@ -441,7 +440,6 @@ throw 'Missing filter argument'; } - var headers = _.extend({}, this._defaultHeaders); // root element with namespaces var body = '