From 36657b74d817c70a2fdcfb336a5ed8b6a5fe8d09 Mon Sep 17 00:00:00 2001 From: 0xngmi <0xngmi@protonmail.com> Date: Tue, 25 Jul 2023 19:58:10 +0100 Subject: [PATCH] reject timestamps not divisible by 3600 --- src/handlers/getBridgeStatsOnDay.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/handlers/getBridgeStatsOnDay.ts b/src/handlers/getBridgeStatsOnDay.ts index adc0eed5..f80f687b 100644 --- a/src/handlers/getBridgeStatsOnDay.ts +++ b/src/handlers/getBridgeStatsOnDay.ts @@ -185,6 +185,11 @@ const getBridgeStatsOnDay = async (timestamp: string = "0", chain: string, bridg const handler = async (event: AWSLambda.APIGatewayEvent): Promise => { const timestamp = event.pathParameters?.timestamp; + if(Number(timestamp) % 3600 !== 0){ + return errorResponse({ + message: "timestamp must be divible by 3600" + }) + } const chain = event.pathParameters?.chain?.toLowerCase() ?? ""; const bridgeNetworkId = event.queryStringParameters?.id; const response = await getBridgeStatsOnDay(timestamp, chain, bridgeNetworkId);