Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-17 13:32:16 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-17 13:32:16 +0300
commit7b0f83b616246c5274b551ab46b923b0989c464e (patch)
tree1a01d85adae09d258012087831a945c0193ebe12
parent92e5160003def4d13d75c3fd755b1753a821a6ce (diff)
parent5575443be96e2a8b9b966fad6e3191f2c0d96740 (diff)
Merge pull request #22445 from owncloud/files-client-sendpropfindheaders
Files DAV client send propfind headers
-rw-r--r--core/js/files/client.js19
-rw-r--r--core/vendor/davclient.js/lib/client.js12
2 files changed, 14 insertions, 17 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 = '<oc:filter-files ';
var namespace;
@@ -472,7 +470,7 @@
this._client.request(
'REPORT',
this._buildUrl(),
- headers,
+ {},
body
).then(function(result) {
if (self._isSuccessStatus(result.status)) {
@@ -542,8 +540,7 @@
this._client.request(
'GET',
- this._buildUrl(path),
- this._defaultHeaders
+ this._buildUrl(path)
).then(
function(result) {
if (self._isSuccessStatus(result.status)) {
@@ -575,7 +572,7 @@
var deferred = $.Deferred();
var promise = deferred.promise();
options = options || {};
- var headers = _.extend({}, this._defaultHeaders);
+ var headers = {};
var contentType = 'text/plain;charset=utf-8';
if (options.contentType) {
contentType = options.contentType;
@@ -616,8 +613,7 @@
this._client.request(
method,
- this._buildUrl(path),
- this._defaultHeaders
+ this._buildUrl(path)
).then(
function(result) {
if (self._isSuccessStatus(result.status)) {
@@ -673,10 +669,9 @@
var self = this;
var deferred = $.Deferred();
var promise = deferred.promise();
- var headers =
- _.extend({
- 'Destination' : this._buildUrl(destinationPath)
- }, this._defaultHeaders);
+ var headers = {
+ 'Destination' : this._buildUrl(destinationPath)
+ };
if (!allowOverwrite) {
headers['Overwrite'] = 'F';
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 =
'<?xml version="1.0"?>\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) {