javascript-solid-server 0.0.128 → 0.0.129
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/src/server.js +15 -8
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -472,15 +472,22 @@ export function createServer(options = {}) {
|
|
|
472
472
|
|
|
473
473
|
// Pod creation endpoint with rate limiting
|
|
474
474
|
// Limit: 1 pod per IP per day to prevent resource exhaustion and namespace squatting
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
475
|
+
// Disabled in single-user mode
|
|
476
|
+
if (singleUser) {
|
|
477
|
+
fastify.post('/.pods', async (request, reply) => {
|
|
478
|
+
return reply.code(403).send({ error: 'Forbidden', message: 'Pod creation disabled in single-user mode' });
|
|
479
|
+
});
|
|
480
|
+
} else {
|
|
481
|
+
fastify.post('/.pods', {
|
|
482
|
+
config: {
|
|
483
|
+
rateLimit: {
|
|
484
|
+
max: 1,
|
|
485
|
+
timeWindow: '1 day',
|
|
486
|
+
keyGenerator: (request) => request.ip
|
|
487
|
+
}
|
|
481
488
|
}
|
|
482
|
-
}
|
|
483
|
-
}
|
|
489
|
+
}, handleCreatePod);
|
|
490
|
+
}
|
|
484
491
|
|
|
485
492
|
// Mashlib CDN mode: redirect chunk requests to CDN
|
|
486
493
|
if (mashlibEnabled && mashlibCdn) {
|