diff --git a/src/backend/src/services/worker/WorkerService.js b/src/backend/src/services/worker/WorkerService.js index 125ada37ed..03c2ec811f 100644 --- a/src/backend/src/services/worker/WorkerService.js +++ b/src/backend/src/services/worker/WorkerService.js @@ -198,8 +198,8 @@ class WorkerService extends BaseService { const currentDomains = await svc_su.sudo(Context.get("actor").get_related_actor(UserActorType), async () => { return (await es_subdomain.select({ predicate: new StartsWith({ key: "subdomain", value: "workers.puter." }) })); }); - if (currentDomains.length >= 10) { - throw APIError.create('subdomain_limit_reached', null, {isWorker: true, limit: 10}); + if (currentDomains.length >= 100) { + throw APIError.create('subdomain_limit_reached', null, {isWorker: true, limit: 100}); } if (this.global_config.reserved_words.includes(workerName)) { diff --git a/src/backend/src/services/worker/src/s2w-router.js b/src/backend/src/services/worker/src/s2w-router.js index ac954d6385..8299203306 100644 --- a/src/backend/src/services/worker/src/s2w-router.js +++ b/src/backend/src/services/worker/src/s2w-router.js @@ -78,6 +78,9 @@ function inits2w() { if (this.handleCors && event.request.method === "OPTIONS" && !mappings) { return this.handleOptions(event.request); } + if (!mappings) { + return new Response(`No routes for given request type ${event.request.method}`, {status: 404}); + } const url = new URL(event.request.url); try { for (const mapping of mappings) {