QString Account::davPath() const
{
+ if (capabilities().chunkingNg()) {
+ // The chunking-ng means the server prefer to use the new webdav URL
+ return QLatin1String("/remote.php/dav/files/") + davUser() + QLatin1Char('/');
+ }
+
// make sure to have a trailing slash
if( !_davPath.endsWith('/') ) {
QString dp(_davPath);
bool Capabilities::chunkingNg() const
{
+ static const auto chunkng = qgetenv("OWNCLOUD_CHUNKING_NG");
+ if (chunkng == "0") return false;
+ if (chunkng == "1") return true;
return _capabilities["dav"].toMap()["chunking"].toByteArray() >= "1.0";
}
return job;
} else {
PropagateUploadFileCommon *job = 0;
- static const auto chunkng = qgetenv("OWNCLOUD_CHUNKING_NG");
- if (item->_size > chunkSize()
- && (account()->capabilities().chunkingNg() || chunkng == "1") && chunkng != "0") {
+ if (item->_size > chunkSize() && account()->capabilities().chunkingNg()) {
job = new PropagateUploadFileNG(this, item);
} else {
job = new PropagateUploadFileV1(this, item);
Q_ASSERT(_jobs.isEmpty()); // There should be no running job anymore
_finished = true;
// Finish with a MOVE
- QString destination = _propagator->account()->url().path()
- + QLatin1String("/remote.php/dav/files/") + _propagator->account()->davUser()
- + _propagator->_remoteFolder + _item->_file;
-
+ QString destination = QDir::cleanPath(_propagator->account()->url().path() + QLatin1Char('/')
+ + _propagator->account()->davPath() + _propagator->_remoteFolder + _item->_file);
auto headers = PropagateUploadFileCommon::headers();
// "If-Match applies to the source, but we are interested in comparing the etag of the destination