Skeleton work

This commit is contained in:
Bryan Ashby 2023-01-03 20:42:36 -07:00
parent 6cea4269b2
commit d4f74447ec
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 9 additions and 2 deletions

View File

@ -38,11 +38,13 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
_selfUrlRequestHandler(req, resp) { _selfUrlRequestHandler(req, resp) {
const accept = req.headers['accept'] || '*/*'; const accept = req.headers['accept'] || '*/*';
if (accept === 'application/activity+json') { if (accept === 'application/activity+json') {
return this._selfActorHandler(req, resp); return this._selfAsActorHandler(req, resp);
} }
return this._standardSelfHandler(req, resp);
} }
_selfActorHandler(req, resp) { _selfAsActorHandler(req, resp) {
const url = new URL(req.url, `https://${req.headers.host}`); const url = new URL(req.url, `https://${req.headers.host}`);
const accountName = url.pathname.substring(url.pathname.lastIndexOf('/') + 1); const accountName = url.pathname.substring(url.pathname.lastIndexOf('/') + 1);
@ -84,6 +86,11 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
}); });
} }
_standardSelfHandler(req, resp) {
// :TODO: this should also be their profile page?! Perhaps that should also be shared...
return this._notFound(resp);
}
_notFound(resp) { _notFound(resp) {
this.webServer.respondWithError( this.webServer.respondWithError(
resp, resp,