@tenonhq/dovetail-dashboard 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.js +7 -2
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1390,6 +1390,11 @@ const todoLimiter = RateLimit({
|
|
|
1390
1390
|
windowMs: 15 * 60 * 1000,
|
|
1391
1391
|
max: 240,
|
|
1392
1392
|
});
|
|
1393
|
+
// Read limiter for the page + list endpoints, which touch the filesystem.
|
|
1394
|
+
const todoReadLimiter = RateLimit({
|
|
1395
|
+
windowMs: 15 * 60 * 1000,
|
|
1396
|
+
max: 300,
|
|
1397
|
+
});
|
|
1393
1398
|
|
|
1394
1399
|
// SSE fan-out for the TODO panel — one frame per connected client.
|
|
1395
1400
|
const todoSseClients = new Set();
|
|
@@ -1430,11 +1435,11 @@ function startTodoWatcher() {
|
|
|
1430
1435
|
todoWatcher.on("unlink", function () { broadcastTodos({ schema_version: 1, items: [] }); });
|
|
1431
1436
|
}
|
|
1432
1437
|
|
|
1433
|
-
app.get("/todos", function (req, res) {
|
|
1438
|
+
app.get("/todos", todoReadLimiter, function (req, res) {
|
|
1434
1439
|
res.sendFile(path.join(__dirname, "public", "todos.html"));
|
|
1435
1440
|
});
|
|
1436
1441
|
|
|
1437
|
-
app.get("/api/todos", function (req, res) {
|
|
1442
|
+
app.get("/api/todos", todoReadLimiter, function (req, res) {
|
|
1438
1443
|
try {
|
|
1439
1444
|
res.json({ list: todoLib.loadList({ rootDir: TODO_DIR }), storage: TODO_DIR });
|
|
1440
1445
|
} catch (e) {
|