Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Return proper status when file didn't exist before
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Aug 13, 2020
commit 818917c3fa04538caaed4e4906684b915801cb29
3 changes: 2 additions & 1 deletion apps/dav/lib/Upload/ChunkingPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function beforeMove($sourcePath, $destination) {
* @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);
Expand All @@ -87,7 +88,7 @@ public function performMove($path, $destination) {

$response = $this->server->httpResponse;
$response->setHeader('Content-Length', '0');
$response->setStatus(204);
$response->setStatus($fileExists ? 204 : 201);

return false;
}
Expand Down