header routing

This commit is contained in:
bronku 2025-11-25 11:45:06 +01:00
parent ef47d7082c
commit 71d1b559a8
5 changed files with 36 additions and 55 deletions

View file

@ -18,6 +18,7 @@ app.MapGet("/{**ok}", async (HttpContext context) =>
var headers = request.Headers;
var responseText = new System.Text.StringBuilder();
responseText.AppendLine("<pre>");
responseText.AppendLine($"Server Name: {name}");
responseText.AppendLine($"IP Address: {ip}");
responseText.AppendLine($"Method: {method}");
@ -30,6 +31,7 @@ app.MapGet("/{**ok}", async (HttpContext context) =>
{
responseText.AppendLine($" {header.Key}: {header.Value}");
}
responseText.AppendLine("</pre>");
await context.Response.WriteAsync(responseText.ToString());
});