-
+
|
diff --git a/packages/client/src/widgets/galaxy/lib/modules/instances.tsx b/packages/client/src/widgets/galaxy/lib/modules/instances.tsx
index 8cb7486..b6b179d 100644
--- a/packages/client/src/widgets/galaxy/lib/modules/instances.tsx
+++ b/packages/client/src/widgets/galaxy/lib/modules/instances.tsx
@@ -82,7 +82,7 @@ export default function Instances({ count, size, color, isCustom }: PropsType) {
instancedMeshRef.current.getMatrixAt(index, tempMatrix);
tempObject.position.setFromMatrixPosition(tempMatrix);
- tempObject.scale.set(scale, scale, scale);
+ if (scale > 0.5) tempObject.scale.set(scale, scale, scale);
tempObject.updateMatrix();
instancedMeshRef.current.setMatrixAt(index++, tempObject.matrix);
}
diff --git a/packages/server/src/admin/admin.service.ts b/packages/server/src/admin/admin.service.ts
index fd58e45..b53d64b 100644
--- a/packages/server/src/admin/admin.service.ts
+++ b/packages/server/src/admin/admin.service.ts
@@ -12,7 +12,6 @@ import { LogInterceptor } from '../interceptor/log.interceptor';
import { HttpExceptionFilter } from '../exception-filter/http.exception-filter';
import * as osUtils from 'os-utils';
import { exec } from 'child_process';
-import { decryptAes } from '../util/aes.util';
import { InjectModel } from '@nestjs/mongoose';
import { Exception } from '../exception-filter/exception.schema';
import { awsConfig, bucketName } from '../config/aws.config';
diff --git a/packages/server/src/board/dto/create-board.dto.ts b/packages/server/src/board/dto/create-board.dto.ts
index 565f2b1..763206e 100644
--- a/packages/server/src/board/dto/create-board.dto.ts
+++ b/packages/server/src/board/dto/create-board.dto.ts
@@ -4,7 +4,7 @@ import { IsJSON, IsNotEmpty, IsString, MaxLength } from 'class-validator';
export class CreateBoardDto {
@IsNotEmpty({ message: '게시글 제목은 필수 입력입니다.' })
@IsString({ message: '게시글 제목은 문자열로 입력해야 합니다.' })
- @MaxLength(255, { message: '게시글 제목은 255자 이내로 입력해야 합니다.' })
+ @MaxLength(20, { message: '게시글 제목은 20자 이내로 입력해야 합니다.' })
@ApiProperty({
description: '게시글 제목',
example: 'test title',
diff --git a/packages/server/src/board/file.service.ts b/packages/server/src/board/file.service.ts
index 3e882f0..40b1196 100644
--- a/packages/server/src/board/file.service.ts
+++ b/packages/server/src/board/file.service.ts
@@ -12,16 +12,26 @@ import * as sharp from 'sharp';
@Injectable()
export class FileService {
async uploadFile(file: Express.Multer.File): Promise {
- if (!file.mimetype.includes('image')) {
- throw new BadRequestException('not an image file');
+ if (
+ !file.mimetype.includes('image') ||
+ !file.originalname.match(/\.(jpg|jpeg|png)$/)
+ ) {
+ throw new BadRequestException('not supported image files');
}
const { buffer } = file;
- const resized_buffer = await sharp(buffer)
- .resize(500, 500, { fit: 'cover' })
- .toFormat('png', { quality: 100 })
- .toBuffer();
+ let resized_buffer;
+ try {
+ resized_buffer = await sharp(buffer)
+ .resize(500, 500, { fit: 'cover' })
+ .toFormat('png', { quality: 100 })
+ .toBuffer();
+ } catch (e) {
+ // sharp에서 지원하지 않는 파일 형식 등의 이유로 리사이징에 실패한 경우 에러 리턴
+ Logger.error(e);
+ throw new InternalServerErrorException('image resize failed');
+ }
const filename = uuid();
diff --git a/packages/server/src/interceptor/transaction.interceptor.ts b/packages/server/src/interceptor/transaction.interceptor.ts
index 412ea7a..4a99342 100644
--- a/packages/server/src/interceptor/transaction.interceptor.ts
+++ b/packages/server/src/interceptor/transaction.interceptor.ts
@@ -2,7 +2,6 @@ import {
CallHandler,
ExecutionContext,
Injectable,
- InternalServerErrorException,
Logger,
NestInterceptor,
} from '@nestjs/common';
diff --git a/packages/server/src/star/dto/update-star.dto.ts b/packages/server/src/star/dto/update-star.dto.ts
index 3581ce6..c2202b3 100644
--- a/packages/server/src/star/dto/update-star.dto.ts
+++ b/packages/server/src/star/dto/update-star.dto.ts
@@ -1,3 +1 @@
-import { PartialType } from '@nestjs/swagger';
-
export class UpdateStarDto {}
|