상위 디렉터리 및 카테고리의 소유권을 검증하지 않던 문제 등 버그 수정 및 Vitest 기반 테스트 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-11 23:45:56 +09:00
1 parent 67989f4741
commit ed732be999
31 files changed
+2057 -42

No files matched your search

+2 -1
View File
@@ -4,7 +4,7 @@ import { stat } from "fs/promises";
import { Readable } from "stream";
import { FileRepo, MediaRepo } from "#lib/server/db/index.js";
const createEncContentStream = async (
export const createEncContentStream = async (
path: string,
iv?: Buffer,
range?: { start?: number; end?: number },
@@ -36,6 +36,7 @@ const createEncContentStream = async (
),
),
range: { start, end, total: totalSize },
isRangeRequest: !!range,
};
};
+1 -1
View File
@@ -7,7 +7,7 @@ import { safeUnlink } from "#lib/server/modules/filesystem.js";
const chunkLocks = new Set<string>();
const isChunkUploaded = (bitmap: Buffer, chunkIndex: number) => {
export const isChunkUploaded = (bitmap: Buffer, chunkIndex: number) => {
chunkIndex -= 1;
const byte = bitmap[Math.floor(chunkIndex / 8)];
return !!byte && (byte & (1 << (chunkIndex % 8))) !== 0; // Postgres sucks