* @return bool|void false to stop handling, void to skip this handler
*/
public function performMove($path, $destination) {
+ $fileExists = $this->server->tree->nodeExists($destination);
// do a move manually, skipping Sabre's default "delete" for existing nodes
try {
$this->server->tree->move($path, $destination);
$response = $this->server->httpResponse;
$response->setHeader('Content-Length', '0');
- $response->setStatus(204);
+ $response->setStatus($fileExists ? 204 : 201);
return false;
}
->with('Content-Length', '0');
$this->response->expects($this->once())
->method('setStatus')
- ->with(204);
+ ->with(201);
$this->request->expects($this->once())
->method('getHeader')
->with('OC-Total-Length')