Skip to content

Commit

Permalink
Merge pull request #168 from boostcampwm2023/feature-be-#167
Browse files Browse the repository at this point in the history
[BE]feat#167 ํŒŒ์ดํ”„, ์„ธ๋ฏธ์ฝœ๋ก , ๋ถ€๋“ฑํ˜ธ ๋“ฑ์˜ ์ปค๋งจ๋“œ ์ฒด์ด๋‹์„ ๋ฐฉ์ง€ํ•œ๋‹ค
  • Loading branch information
flydog98 committed Nov 28, 2023
2 parents f577995 + 5e92fce commit af8dfae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ export class CommandGuard implements CanActivate {
return (
typeof mode === 'string' &&
typeof message === 'string' &&
(mode === 'editor' || (mode === 'command' && message.startsWith('git')))
(mode === 'editor' ||
(mode === 'command' &&
message.startsWith('git') &&
!this.isMessageIncluded(message, [';', '>', '|', '<'])))
);
}
private isMessageIncluded(message: string, keywords: string[]): boolean {
return keywords.some((keyword) => message.includes(keyword));
}
}
2 changes: 1 addition & 1 deletion packages/backend/src/quizzes/quizzes.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Response } from 'express';
import { ContainersService } from '../containers/containers.service';
import { SessionId } from '../session/session.decorator';
import { SessionGuard } from '../session/session.guard';
import { CommandGuard } from '../command.guard';
import { CommandGuard } from '../common/command.guard';
import { QuizWizardService } from '../quiz-wizard/quiz-wizard.service';
import { Fail, SubmitDto, Success } from './dto/submit.dto';

Expand Down

0 comments on commit af8dfae

Please sign in to comment.