fix(server): file sending and cache control (#5829)

* fix: file sending

* fix: tests
This commit is contained in:
Jason Rasmussen
2023-12-18 11:33:46 -05:00
committed by GitHub
parent ffc31f034c
commit d3e1572229
17 changed files with 132 additions and 98 deletions

View File

@@ -16,10 +16,16 @@ import { CronJob } from 'cron';
import { basename, extname } from 'node:path';
import sanitize from 'sanitize-filename';
export enum CacheControl {
PRIVATE_WITH_CACHE = 'private_with_cache',
PRIVATE_WITHOUT_CACHE = 'private_without_cache',
NONE = 'none',
}
export class ImmichFileResponse {
public readonly path!: string;
public readonly contentType!: string;
public readonly cacheControl!: boolean;
public readonly cacheControl!: CacheControl;
constructor(response: ImmichFileResponse) {
Object.assign(this, response);