mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -05:00
FileMediaBackend: Fix generated urls
All urls should be of the form `uploads/<filename>.<extension>` regardless of what the uploadDirectory is, because the backend proxies all locally uploaded files. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
c821fe6f04
commit
4fb7623225
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ export class FilesystemBackend implements MediaBackend {
|
||||||
await this.ensureDirectory();
|
await this.ensureDirectory();
|
||||||
try {
|
try {
|
||||||
await fs.writeFile(filePath, buffer, null);
|
await fs.writeFile(filePath, buffer, null);
|
||||||
return ['/' + filePath, null];
|
return ['/uploads/' + fileName, null];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
||||||
throw new MediaBackendError(`Could not save '${filePath}'`);
|
throw new MediaBackendError(`Could not save '${filePath}'`);
|
||||||
|
|
Loading…
Reference in a new issue