Skip to content

Commit

Permalink
Add X-Robots-Tag to prevent indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-r-elp committed Dec 29, 2024
1 parent a67a9c7 commit 4cf0f41
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BeatTogether.Status.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
)
.Configure(applicationBuilder =>
applicationBuilder
.UseRouting()
.Use((context, next) =>
{
context.Response.Headers.Add("X-Robots-Tag", "noindex, nofollow"); // Tell everyone that we don't want to be indexed
return next(context);
})
.UseRouting()
.UseEndpoints(endPointRouteBuilder => endPointRouteBuilder.MapControllers())
)
)
Expand Down

0 comments on commit 4cf0f41

Please sign in to comment.