Commit 0b13e4c
committed
fix(web): rate-limit /api/docs/search
The route had zero throttling beyond a 128-char query cap, unlike every
other demo endpoint. A scripted client could hit it at unlimited req/s
from one IP. Reuse the existing in-memory clientIp/checkWebhookCooldown
pair from lib/demo-limits.ts, same pattern as /api/webhook-sample.
SearchDialog cast res.json() straight to SearchResult[] with no res.ok
check, so a 429 envelope would have been treated as a result array and
broken rendering - fixed alongside the rate limit that would trigger it.1 parent b972e76 commit 0b13e4c
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
0 commit comments