File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 77 orderBy ,
88 uniqBy ,
99} from 'lodash' ;
10- import { ConflictException , Injectable } from '@nestjs/common' ;
10+ import { BadRequestException , ConflictException , Injectable } from '@nestjs/common' ;
1111import { isUUID } from 'class-validator' ;
1212import { ENV_CONFIG } from 'src/config' ;
1313import { Logger } from 'src/shared/global' ;
@@ -66,9 +66,7 @@ export class ChallengesService {
6666 throw new BadRequestException ( 'Invalid challengeId provided! Uuid expected!' ) ;
6767 }
6868
69- // Use the URL constructor to avoid path traversal/SSRF risks.
70- const baseUrl = TC_API_BASE . endsWith ( '/' ) ? TC_API_BASE . slice ( 0 , - 1 ) : TC_API_BASE ;
71- const requestUrl = new URL ( `/challenges/${ challengeId } ` , baseUrl ) . toString ( ) ;
69+ const requestUrl = `${ TC_API_BASE } /challenges/${ challengeId } ` ;
7270
7371 try {
7472 const challenge = await this . m2MService . m2mFetch < Challenge > ( requestUrl ) ;
You can’t perform that action at this time.
0 commit comments