Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

fix directory hits having / removed

+17 -2
+2 -1
apps/hosting-service/src/server.ts
··· 51 const hostname = c.req.header('host') || ''; 52 const hostnameWithoutPort = hostname.split(':')[0] || ''; 53 const rawPath = url.pathname.replace(/^\//, ''); 54 - const path = sanitizePath(rawPath); 55 56 logger.debug(`Request: host=${hostname} hostnameWithoutPort=${hostnameWithoutPort} path=${path}`, { BASE_HOST }); 57
··· 51 const hostname = c.req.header('host') || ''; 52 const hostnameWithoutPort = hostname.split(':')[0] || ''; 53 const rawPath = url.pathname.replace(/^\//, ''); 54 + const hasTrailingSlash = rawPath.endsWith('/'); 55 + const path = hasTrailingSlash ? sanitizePath(rawPath) + '/' : sanitizePath(rawPath); 56 57 logger.debug(`Request: host=${hostname} hostnameWithoutPort=${hostnameWithoutPort} path=${path}`, { BASE_HOST }); 58
+15 -1
apps/main-app/src/routes/domain.ts
··· 327 throw new Error('Domain parameter required'); 328 } 329 330 // Update wisp.place domain to point to this site 331 - await updateWispDomainSite(domain, siteRkey); 332 333 return { success: true }; 334 } catch (err) {
··· 327 throw new Error('Domain parameter required'); 328 } 329 330 + // Verify domain belongs to user 331 + const domainLower = normalizeDomain(domain); 332 + const info = await isDomainRegistered(domainLower); 333 + 334 + if (!info.registered || info.type !== 'wisp') { 335 + set.status = 404 336 + throw new Error('Domain not found'); 337 + } 338 + 339 + if (info.did !== auth.did) { 340 + set.status = 403 341 + throw new Error('Unauthorized: You do not own this domain'); 342 + } 343 + 344 // Update wisp.place domain to point to this site 345 + await updateWispDomainSite(domainLower, siteRkey); 346 347 return { success: true }; 348 } catch (err) {