mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Return proper status when file didn't exist before
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
d0d5275474
commit
818917c3fa
1 changed files with 2 additions and 1 deletions
|
|
@ -69,6 +69,7 @@ class ChunkingPlugin extends ServerPlugin {
|
|||
* @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);
|
||||
|
|
@ -87,7 +88,7 @@ class ChunkingPlugin extends ServerPlugin {
|
|||
|
||||
$response = $this->server->httpResponse;
|
||||
$response->setHeader('Content-Length', '0');
|
||||
$response->setStatus(204);
|
||||
$response->setStatus($fileExists ? 204 : 201);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue