Skip to content

Commit 5541325

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
Return proper status when file didn't exist before
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent e9bd87a commit 5541325

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/dav/lib/Upload/ChunkingPlugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function beforeMove($sourcePath, $destination) {
6868
* @return bool|void false to stop handling, void to skip this handler
6969
*/
7070
public function performMove($path, $destination) {
71+
$fileExists = $this->server->tree->nodeExists($destination);
7172
// do a move manually, skipping Sabre's default "delete" for existing nodes
7273
try {
7374
$this->server->tree->move($path, $destination);
@@ -86,7 +87,7 @@ public function performMove($path, $destination) {
8687

8788
$response = $this->server->httpResponse;
8889
$response->setHeader('Content-Length', '0');
89-
$response->setStatus(204);
90+
$response->setStatus($fileExists ? 204 : 201);
9091

9192
return false;
9293
}

0 commit comments

Comments
 (0)