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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +15 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.128",
3
+ "version": "0.0.129",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
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
- fastify.post('/.pods', {
476
- config: {
477
- rateLimit: {
478
- max: 1,
479
- timeWindow: '1 day',
480
- keyGenerator: (request) => request.ip
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
- }, handleCreatePod);
489
+ }, handleCreatePod);
490
+ }
484
491
 
485
492
  // Mashlib CDN mode: redirect chunk requests to CDN
486
493
  if (mashlibEnabled && mashlibCdn) {