mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
MOVE: fix moving with special character.
The Destination header need to be %-encoded
This commit is contained in:
parent
c712b7c46c
commit
7b4be209aa
2 changed files with 11 additions and 1 deletions
|
@ -141,6 +141,16 @@ move( localDir() . '3.txt', localDir() . '3_bis.txt' );
|
|||
system( "echo \"new file un\" > " . localDir() . '1.txt' );
|
||||
system( "echo \"new file trois\" > " . localDir() . '3.txt' );
|
||||
|
||||
#also add special file with special character for next sync
|
||||
#and file with special characters
|
||||
createLocalFile(localDir(). 'hêllo%20th@re.txt' , 1208 );
|
||||
|
||||
csync();
|
||||
assertLocalAndRemoteDir( '', 0);
|
||||
|
||||
printInfo("Move a file containing special character");
|
||||
|
||||
move(localDir(). 'hêllo%20th@re.txt', localDir(). 'hêllo%20th@re.doc');
|
||||
csync();
|
||||
assertLocalAndRemoteDir( '', 0);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ MoveJob::MoveJob(Account* account, const QString& path,
|
|||
void MoveJob::start()
|
||||
{
|
||||
QNetworkRequest req;
|
||||
req.setRawHeader("Destination", _destination.toUtf8());
|
||||
req.setRawHeader("Destination", QUrl::toPercentEncoding(_destination, "/"));
|
||||
setReply(davRequest("MOVE", path(), req));
|
||||
setupConnections(reply());
|
||||
|
||||
|
|
Loading…
Reference in a new issue