tangled
alpha
login
or
join now
nekomimi.pet
/
wisp.place-monorepo
88
fork
atom
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
88
fork
atom
overview
issues
10
pulls
pipelines
fix directory hits having / removed
nekomimi.pet
6 days ago
525bc4ee
2cdb908a
1/2
deploy-wisp.yml
success
44s
test.yml
failed
46s
+17
-2
2 changed files
expand all
collapse all
unified
split
apps
hosting-service
src
server.ts
main-app
src
routes
domain.ts
+2
-1
apps/hosting-service/src/server.ts
···
51
51
const hostname = c.req.header('host') || '';
52
52
const hostnameWithoutPort = hostname.split(':')[0] || '';
53
53
const rawPath = url.pathname.replace(/^\//, '');
54
54
-
const path = sanitizePath(rawPath);
54
54
+
const hasTrailingSlash = rawPath.endsWith('/');
55
55
+
const path = hasTrailingSlash ? sanitizePath(rawPath) + '/' : sanitizePath(rawPath);
55
56
56
57
logger.debug(`Request: host=${hostname} hostnameWithoutPort=${hostnameWithoutPort} path=${path}`, { BASE_HOST });
57
58
+15
-1
apps/main-app/src/routes/domain.ts
···
327
327
throw new Error('Domain parameter required');
328
328
}
329
329
330
330
+
// Verify domain belongs to user
331
331
+
const domainLower = normalizeDomain(domain);
332
332
+
const info = await isDomainRegistered(domainLower);
333
333
+
334
334
+
if (!info.registered || info.type !== 'wisp') {
335
335
+
set.status = 404
336
336
+
throw new Error('Domain not found');
337
337
+
}
338
338
+
339
339
+
if (info.did !== auth.did) {
340
340
+
set.status = 403
341
341
+
throw new Error('Unauthorized: You do not own this domain');
342
342
+
}
343
343
+
330
344
// Update wisp.place domain to point to this site
331
331
-
await updateWispDomainSite(domain, siteRkey);
345
345
+
await updateWispDomainSite(domainLower, siteRkey);
332
346
333
347
return { success: true };
334
348
} catch (err) {