diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2025-05-04 09:38:35 +0900 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2025-05-08 20:03:53 +0200 |
| commit | e40f3917f39da7e14cd11b89e6506862e7b92d11 (patch) | |
| tree | efe23e13f9f32f682216523aa2d8fc09e921c17f /packages/backend/src | |
| parent | Revert "fix: 添付ファイルのあるリクエストを受けたときの... (diff) | |
| download | sharkey-e40f3917f39da7e14cd11b89e6506862e7b92d11.tar.gz sharkey-e40f3917f39da7e14cd11b89e6506862e7b92d11.tar.bz2 sharkey-e40f3917f39da7e14cd11b89e6506862e7b92d11.zip | |
refactor: ファイルアップロード時のテストを追加 (#15928)
* refactor: ファイルアップロード時のテストを追加
* なぜかsemverが消えてた
Diffstat (limited to 'packages/backend/src')
| -rw-r--r-- | packages/backend/src/server/ServerService.ts | 9 | ||||
| -rw-r--r-- | packages/backend/src/server/api/endpoints/drive/files/create.ts | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index dce47e2290..2d20aa1222 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -7,7 +7,7 @@ import cluster from 'node:cluster'; import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; -import Fastify, { FastifyInstance } from 'fastify'; +import Fastify, { type FastifyInstance } from 'fastify'; import fastifyStatic from '@fastify/static'; import fastifyRawBody from 'fastify-raw-body'; import { IsNull } from 'typeorm'; @@ -312,6 +312,13 @@ export class ServerService implements OnApplicationShutdown { await this.#fastify.close(); } + /** + * Get the Fastify instance for testing. + */ + public get fastify(): FastifyInstance { + return this.#fastify; + } + @bindThis async onApplicationShutdown(signal: string): Promise<void> { await this.dispose(); diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 7043f4883a..f4c47d71bf 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -67,6 +67,7 @@ export const meta = { message: 'Cannot upload the file because it exceeds the maximum file size.', code: 'MAX_FILE_SIZE_EXCEEDED', id: 'b9d8c348-33f0-4673-b9a9-5d4da058977a', + httpStatusCode: 413, }, }, } as const; |