mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
16 lines
350 B
TypeScript
16 lines
350 B
TypeScript
import { Get, Query } from '@nestjs/common';
|
|
import { IsIn } from 'class-validator';
|
|
|
|
export class Controller {
|
|
@Get()
|
|
route1(@Query('x') validatedObj: Struct, @Query('y') unvalidated: string) {
|
|
if (Math.random()) return unvalidated; // NOT OK
|
|
return validatedObj.key; // OK
|
|
}
|
|
}
|
|
|
|
class Struct {
|
|
@IsIn(['foo', 'bar'])
|
|
key: string;
|
|
}
|