Skip to content

Commit

Permalink
MOVE: fix moving with special character.
Browse files Browse the repository at this point in the history
The Destination header need to be %-encoded
  • Loading branch information
ogoffart committed Nov 11, 2014
1 parent c712b7c commit 7b4be20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions csync/tests/ownCloud/t3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@
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%[email protected]' , 1208 );

csync();
assertLocalAndRemoteDir( '', 0);

printInfo("Move a file containing special character");

move(localDir(). 'hêllo%[email protected]', localDir(). 'hêllo%[email protected]');
csync();
assertLocalAndRemoteDir( '', 0);

Expand Down
2 changes: 1 addition & 1 deletion src/libsync/propagateremotemove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 7b4be20

Please sign in to comment.