summaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@hey.com>2024-02-02 12:14:38 +0000
committerRaphael Kabo <raphaelkabo@hey.com>2024-02-02 12:14:38 +0000
commit7bd4eb728d27636321e9ac6dadd764ef5fa95af1 (patch)
tree4db3ca79cc85f3022918096cd5d443d4531f0759 /src/app.ts
parentfbd2dd29739b76e76855a3d4c87d9d43da2953c2 (diff)
refactor: send and accept only spec-compliant AP headers
Diffstat (limited to 'src/app.ts')
-rwxr-xr-xsrc/app.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/app.ts b/src/app.ts
index 3370d27..f3c99c7 100755
--- a/src/app.ts
+++ b/src/app.ts
@@ -9,6 +9,10 @@ import group from "./routes/group.js";
import staticPages from "./routes/static.js";
import { initEmailService } from "./lib/email.js";
+import {
+ activityPubContentType,
+ alternateActivityPubContentType,
+} from "./lib/activitypub.js";
const app = express();
@@ -48,8 +52,8 @@ app.set("hbsInstance", hbsInstance);
app.use(express.static("public"));
// Body parser //
-app.use(express.json({ type: "application/activity+json" }));
-app.use(express.json({ type: "application/ld+json" }));
+app.use(express.json({ type: alternateActivityPubContentType }));
+app.use(express.json({ type: activityPubContentType }));
app.use(express.json({ type: "application/json" }));
app.use(express.urlencoded({ extended: true }));