From 3757d6abfc2d55cdc4202749d8a63ea145db8e22 Mon Sep 17 00:00:00 2001 From: Ezedike-egwom Collins Date: Thu, 6 Aug 2026 07:46:55 +0100 Subject: [PATCH] fix(api): add missing rate limit to GET /vaults/:vaultId --- api/v1/vaults/[vaultId].ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v1/vaults/[vaultId].ts b/api/v1/vaults/[vaultId].ts index 19c431ce..9b3ec055 100644 --- a/api/v1/vaults/[vaultId].ts +++ b/api/v1/vaults/[vaultId].ts @@ -1,7 +1,7 @@ import type { VercelRequest, VercelResponse } from "@vercel/node"; import { KNOWN_POOLS } from "@meridian/stellar-sdk-helpers"; import { handleGetVaultById } from "@meridian/api-core"; -import { applyCors } from "../../_lib/middleware.js"; +import { applyCors, checkRateLimit } from "../../_lib/middleware.js"; const CACHE_CONTROL = "public, s-maxage=60, stale-while-revalidate=300"; const KNOWN_VAULT_IDS = new Set( @@ -13,6 +13,7 @@ const KNOWN_VAULT_IDS = new Set( export default async function handler(req: VercelRequest, res: VercelResponse) { if (applyCors(req, res)) return; + if (!(await checkRateLimit(req, res))) return; const raw = req.query["vaultId"]; const vaultId = typeof raw === "string" ? raw : undefined; if (!vaultId) return res.status(400).json({ error: "vaultId is required" });