set X-Robots-Tag to disable indexing API endpoints
This commit is contained in:
parent
99bf315351
commit
b44abe0eaa
5 changed files with 23 additions and 0 deletions
|
|
@ -125,6 +125,10 @@ export class UrlPreviewService {
|
|||
reply: FastifyReply,
|
||||
): Promise<void> {
|
||||
if (!this.meta.urlPreviewEnabled) {
|
||||
// Tell crawlers not to index URL previews.
|
||||
// https://developers.google.com/search/docs/crawling-indexing/block-indexing
|
||||
reply.header('X-Robots-Tag', 'noindex');
|
||||
|
||||
return reply.code(403).send({
|
||||
error: {
|
||||
message: 'URL preview is disabled',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue