summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2017-11-10 15:35:58 +0100
committerGitHub <noreply@github.com>2017-11-10 15:35:58 +0100
commit1a2f9fe678fce329c37b69df47164a2eddead8f1 (patch)
tree0648f61ec8e3f2ff9c526a90e7858a28a9829764 /core/js
parentd3e7dd19928e90c87a4732a9c28020336dab57c7 (diff)
parentcd8d13b9e6e7bbf0e17f31c60021804ac4772939 (diff)
downloadnextcloud-server-1a2f9fe678fce329c37b69df47164a2eddead8f1.tar.gz
nextcloud-server-1a2f9fe678fce329c37b69df47164a2eddead8f1.zip
Merge pull request #7056 from nextcloud/oc-28415-enable-chunking-in-authenticated-web-upload
[oc] Enable chunking for bigger files in authenticated web upload
Diffstat (limited to 'core/js')
-rw-r--r--core/js/files/client.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/js/files/client.js b/core/js/files/client.js
index dc9f6ade641..e810381342a 100644
--- a/core/js/files/client.js
+++ b/core/js/files/client.js
@@ -37,6 +37,7 @@
}
url += options.host + this._root;
+ this._host = options.host;
this._defaultHeaders = options.defaultHeaders || {
'X-Requested-With': 'XMLHttpRequest',
'requesttoken': OC.requestToken
@@ -698,10 +699,11 @@
* @param {String} destinationPath destination path
* @param {boolean} [allowOverwrite=false] true to allow overwriting,
* false otherwise
+ * @param {Object} [headers=null] additional headers
*
* @return {Promise} promise
*/
- move: function(path, destinationPath, allowOverwrite) {
+ move: function(path, destinationPath, allowOverwrite, headers) {
if (!path) {
throw 'Missing argument "path"';
}
@@ -712,9 +714,9 @@
var self = this;
var deferred = $.Deferred();
var promise = deferred.promise();
- var headers = {
+ headers = _.extend({}, headers, {
'Destination' : this._buildUrl(destinationPath)
- };
+ });
if (!allowOverwrite) {
headers.Overwrite = 'F';
@@ -828,6 +830,16 @@
*/
getBaseUrl: function() {
return this._client.baseUrl;
+ },
+
+ /**
+ * Returns the host
+ *
+ * @since 13.0.0
+ * @return {String} base URL
+ */
+ getHost: function() {
+ return this._host;
}
};