Skip to content

feat(recommend): add IP-based rate limiting to AI recommendation endpoint#17

Open
luojiyin1987 wants to merge 1 commit into
FenjuFu:mainfrom
luojiyin1987:feat/recommend-rate-limit
Open

feat(recommend): add IP-based rate limiting to AI recommendation endpoint#17
luojiyin1987 wants to merge 1 commit into
FenjuFu:mainfrom
luojiyin1987:feat/recommend-rate-limit

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Jun 7, 2026

Copy link
Copy Markdown

Closes #16

改动

app/api/ai/recommend/route.ts 新增基于 IP 的滑动窗口限流:

  • 通过 x-forwarded-for / x-real-ip 提取客户端 IP
  • 60s 窗口内每 IP 最多 5 次请求
  • 超限返回 429 + fallback_rate_limited,不消耗 AI 配额

@netlify

netlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

👷 Deploy request for goodaction-hub pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3088fc4

@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

@luojiyin1987 is attempting to deploy a commit to the Fenju's projects Team on Vercel.

A member of the Team first needs to authorize it.

@luojiyin1987 luojiyin1987 force-pushed the feat/recommend-rate-limit branch from d285ba6 to 3088fc4 Compare June 7, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add rate limiting to AI recommend endpoint

1 participant