summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-12-31 16:17:45 +0000
committerdakkar <dakkar@thenautilus.net>2023-12-31 16:17:45 +0000
commit61c193c08f17c00b643f3d7087858b5a2f7693ce (patch)
treedca374deae3935cf6ab5c444e4c1a5682c894e39 /packages
parentauth-fetch: ask to never cache responses (diff)
downloadsharkey-61c193c08f17c00b643f3d7087858b5a2f7693ce.tar.gz
sharkey-61c193c08f17c00b643f3d7087858b5a2f7693ce.tar.bz2
sharkey-61c193c08f17c00b643f3d7087858b5a2f7693ce.zip
lint
Diffstat (limited to 'packages')
-rw-r--r--packages/backend/src/server/ActivityPubServerService.ts48
1 files changed, 16 insertions, 32 deletions
diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts
index c3992eac80..8fa8320c8c 100644
--- a/packages/backend/src/server/ActivityPubServerService.ts
+++ b/packages/backend/src/server/ActivityPubServerService.ts
@@ -329,13 +329,11 @@ export class ActivityPubServerService {
if (profile.followersVisibility === 'private') {
reply.code(403);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=30');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=30');
return;
} else if (profile.followersVisibility === 'followers') {
reply.code(403);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=30');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=30');
return;
}
//#endregion
@@ -387,8 +385,7 @@ export class ActivityPubServerService {
user.followersCount,
`${partOf}?page=true`,
);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(rendered));
}
@@ -426,13 +423,11 @@ export class ActivityPubServerService {
if (profile.followingVisibility === 'private') {
reply.code(403);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=30');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=30');
return;
} else if (profile.followingVisibility === 'followers') {
reply.code(403);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=30');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=30');
return;
}
//#endregion
@@ -484,8 +479,7 @@ export class ActivityPubServerService {
user.followingCount,
`${partOf}?page=true`,
);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(rendered));
}
@@ -526,8 +520,7 @@ export class ActivityPubServerService {
renderedNotes,
);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(rendered));
}
@@ -618,8 +611,7 @@ export class ActivityPubServerService {
`${partOf}?page=true`,
`${partOf}?page=true&since_id=000000000000000000000000`,
);
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(rendered));
}
@@ -632,8 +624,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(await this.apRendererService.renderPerson(user as MiLocalUser)));
}
@@ -723,8 +714,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return this.apRendererService.addContext(await this.apRendererService.renderNote(note, false));
});
@@ -747,8 +737,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(await this.packActivity(note)));
});
@@ -793,8 +782,7 @@ export class ActivityPubServerService {
const keypair = await this.userKeypairService.getUserKeypair(user.id);
if (this.userEntityService.isLocalUser(user)) {
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(this.apRendererService.renderKey(user, keypair)));
} else {
@@ -844,8 +832,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(await this.apRendererService.renderEmoji(emoji)));
});
@@ -868,8 +855,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, note)));
});
@@ -897,8 +883,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(this.apRendererService.renderFollow(follower, followee)));
});
@@ -935,8 +920,7 @@ export class ActivityPubServerService {
return;
}
- if (!this.config.checkActivityPubGetSignature)
- reply.header('Cache-Control', 'public, max-age=180');
+ if (!this.config.checkActivityPubGetSignature) reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.addContext(this.apRendererService.renderFollow(follower, followee)));
});