File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,12 @@ export class AppController extends AbstractController {
8383 @Param ( 'project' ) project ?: string ,
8484 @Query ( 'current' ) current ?: string ,
8585 ) : Promise < Response > {
86+ const validProjects = [ 'sesame-orchestrator' , 'sesame-daemon' , 'sesame-app-manager' ] ;
87+ if ( ! validProjects . includes ( project ) ) {
88+ throw new BadRequestException ( `Invalid project: ${ project } ` ) ;
89+ }
90+
8691 let data = < GithubUpdate > { } ;
87- // console.log('this.storage', storage.get(project))
8892 if ( storage . has ( project ) ) {
8993 this . logger . log ( `Fetching ${ project } tags from cache` ) ;
9094 data = storage . get ( project ) as GithubUpdate ;
@@ -96,7 +100,6 @@ export class AppController extends AbstractController {
96100 data = await update . json ( ) ;
97101 console . log ( 'update' , data )
98102 storage . set ( project , data ) ;
99- // console.log('this.storage', storage.get(project))
100103 }
101104 // if (!Array.isArray(data)) {
102105 // throw new BadRequestException(`Invalid data from Github <${JSON.stringify(data)}>`);
You can’t perform that action at this time.
0 commit comments