@@ -16,7 +16,6 @@ router.get('/:name', async (req, res) => {
1616 const domain = req . app . get ( 'domain' ) ;
1717 const username = name ;
1818 name = `${ name } @${ domain } ` ;
19-
2019 const actor = await db . getActor ( ) ;
2120
2221 if ( actor === undefined ) {
@@ -31,6 +30,7 @@ router.get('/:name', async (req, res) => {
3130 if ( tempActor . outbox === undefined ) {
3231 tempActor . outbox = `https://${ domain } /u/${ username } /outbox` ;
3332 }
33+ res . setHeader ( 'Content-Type' , 'application/activity+json' ) ;
3434 return res . json ( tempActor ) ;
3535} ) ;
3636
@@ -63,6 +63,7 @@ router.get('/:name/followers', async (req, res) => {
6363 } ,
6464 '@context' : [ 'https://www.w3.org/ns/activitystreams' ] ,
6565 } ;
66+ res . setHeader ( 'Content-Type' , 'application/activity+json' ) ;
6667 return res . json ( followersCollection ) ;
6768} ) ;
6869
@@ -90,6 +91,7 @@ router.get('/:name/following', async (req, res) => {
9091 } ,
9192 '@context' : [ 'https://www.w3.org/ns/activitystreams' ] ,
9293 } ;
94+ res . setHeader ( 'Content-Type' , 'application/activity+json' ) ;
9395 return res . json ( followingCollection ) ;
9496} ) ;
9597
@@ -116,6 +118,7 @@ router.get('/:name/outbox', async (req, res) => {
116118 last : pageLink ( lastPage ) ,
117119 '@context' : [ 'https://www.w3.org/ns/activitystreams' ] ,
118120 } ;
121+ res . setHeader ( 'Content-Type' , 'application/activity+json' ) ;
119122
120123 return res . json ( outboxCollection ) ;
121124 }
@@ -147,6 +150,7 @@ router.get('/:name/outbox', async (req, res) => {
147150 if ( page > 1 ) {
148151 collectionPage . prev = pageLink ( page - 1 ) ;
149152 }
153+ res . setHeader ( 'Content-Type' , 'application/activity+json' ) ;
150154
151155 return res . json ( collectionPage ) ;
152156} ) ;
0 commit comments