Set the correct content types for ActivityPub on JSON body parser

parent d310b3f6
......@@ -31,7 +31,11 @@ app.configure(configuration())
app.use(cors())
app.use(helmet())
app.use(compress())
app.use(express.json())
// Make sure the body parser is configured to parse ActivityPub content types
// or else the body will appear empty in the route handlers.
app.use(express.json({type: ['application/json', 'application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"']}))
app.use(express.urlencoded({ extended: true }))
app.use(favicon(path.join(app.get('public'), 'favicon.ico')))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment