LANCommander/LANCommander.Server/Middlewares/RobotsMiddleware.cs
2025-03-10 21:40:17 -05:00

20 lines
543 B
C#

using LANCommander.Server.Services;
namespace LANCommander.Server
{
public class RobotsMiddleware(RequestDelegate next)
{
public async Task InvokeAsync(HttpContext context)
{
if (context.Request.Path.StartsWithSegments("/robots.txt"))
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("User-agent: *\nDisallow: /Identity/");
return;
}
await next(context);
}
}
}