mirror of
https://github.com/immich-app/immich.git
synced 2026-02-12 20:08:25 +03:00
set max-age limit
This commit is contained in:
@@ -447,13 +447,4 @@ describe(AssetUploadController.name, () => {
|
||||
expect(status).toBe(400);
|
||||
});
|
||||
});
|
||||
|
||||
describe('OPTIONS /upload', () => {
|
||||
it('should return 204 with upload limits', async () => {
|
||||
const { status, headers } = await request(ctx.getHttpServer()).options('/upload');
|
||||
|
||||
expect(status).toBe(204);
|
||||
expect(headers['upload-limit']).toBe('min-size=0');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,17 +1,4 @@
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Head,
|
||||
Header,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Options,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
Req,
|
||||
Res,
|
||||
} from '@nestjs/common';
|
||||
import { Controller, Delete, Head, Options, Param, Patch, Post, Req, Res } from '@nestjs/common';
|
||||
import { ApiHeader, ApiOkResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { Request, Response } from 'express';
|
||||
import {
|
||||
@@ -120,7 +107,7 @@ export class AssetUploadController {
|
||||
}
|
||||
|
||||
@Options()
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Header('Upload-Limit', 'min-size=0')
|
||||
getUploadOptions() {}
|
||||
getUploadOptions(@Res() res: Response) {
|
||||
return this.service.getUploadOptions(res);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user