Skip to content

Commit

Permalink
reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
shineli1984 committed Aug 23, 2024
1 parent 60206e0 commit 6b798b6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ const packages: { [key: string]: any } = {
// TODO: no deployment of alpha package on flux commit
// TODO: env for production vs sandbox
// TODO: write wrapper for methods. because date/time type are just strings from JSON body
server.post('/v1/ts-sdk/v1/:pkg/:method', async (request: any, reply) => {
server.post('/v1/ts-sdk/v1/:pkg/:method', async (request: any) => {
const { pkg, method } = request.params;
if (Object.keys(packages).indexOf(pkg) === -1) {
return reply.code(400).send({ error: 'Invalid package' });
}
return await packages[pkg][method](...request.body);

Check failure

Code scanning / CodeQL

Unvalidated dynamic method call High

Invocation of method with
user-controlled
name may dispatch to unexpected target and cause an exception.
});

Expand Down

0 comments on commit 6b798b6

Please sign in to comment.