fix note creation on encrypted s3 storage
This commit is contained in:
parent
23168c56bf
commit
6001c37481
|
@ -176,7 +176,6 @@ class NotesController extends Controller {
|
|||
public function create(string $category) : JSONResponse {
|
||||
return $this->helper->handleErrorResponse(function () use ($category) {
|
||||
$note = $this->notesService->create($this->helper->getUID(), '', $category);
|
||||
$note->setContent('');
|
||||
return $note->getData();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -108,18 +108,6 @@ class NotesService {
|
|||
// create file
|
||||
$file = $folder->newFile($filename);
|
||||
|
||||
// try to write some content
|
||||
try {
|
||||
// If server-side encryption is activated, the server creates an empty file without signature
|
||||
// which leads to an GenericEncryptionException('Missing Signature') afterwards.
|
||||
// Saving a space-char (and removing it later) is a working work-around.
|
||||
$file->putContent(' ');
|
||||
} catch (\Throwable $e) {
|
||||
// if writing the content fails, we have to roll back the note creation
|
||||
$this->delete($userId, $file->getId());
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return new Note($file, $notesFolder, $this->noteUtil);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue